Treehydra: Segfaults in attempt to access 'u5' union member(inner functions should be called eagerly)

RESOLVED FIXED

Status

Firefox Build System
Source Code Analysis
RESOLVED FIXED
10 years ago
2 months ago

People

(Reporter: dmandelin, Unassigned)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(2 attachments)

(Reporter)

Description

10 years ago
Apparently this is caused by generated code in lazy_lang_decl storing pointers to GCC inline functions on the heap, which then get called later in ResolveTreeNode, when they are invalid.

Updated

10 years ago
Status: NEW → ASSIGNED
Summary: Treehydra: Segfaults in attempt to access 'u5' union member → Treehydra: Segfaults in attempt to access 'u5' union member(inner functions should be called eagerly)
(Reporter)

Comment 1

10 years ago
Not that I have any strong opinions on this, but I was thinking "not using nested functions" was a reasonable alternate solution. :-)

Comment 2

10 years ago
It's reasonable, but it's much easier with nested functions. If one starts inlining what's currently nested functions then convert_tree gets a lot more complicated. I tried that approach and it was messy, the generated code looked uglier and I couldn't bother to rewriting large parts of convert_tree js once I realized how much simpler nested functions are.

Personally, I think nested functions should be part of the C/C++ standards, as they allow for much more concise code.
(Reporter)

Comment 3

10 years ago
Created attachment 318484 [details]
Test case treehydra script
(Reporter)

Comment 4

10 years ago
Created attachment 318485 [details]
Test case C++ file

Comment 5

10 years ago
Happens on mac too.

Comment 6

10 years ago
pushed fix
Status: ASSIGNED → RESOLVED
Last Resolved: 10 years ago
Resolution: --- → FIXED

Updated

2 months ago
Product: Core → Firefox Build System
You need to log in before you can comment on or make changes to this bug.