Closed Bug 646574 Opened 12 years ago Closed 12 years ago

dis() is broken when function has upvars

Categories

(Core :: JavaScript Engine, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla7

People

(Reporter: jruderman, Assigned: Waldo)

References

Details

(Keywords: regression, testcase, Whiteboard: fixed-in-tracemonkey)

Attachments

(1 file)

Regression from rev cc4fdccc1135 (bug 396512).

Works:
dis("-r", function f(v) { return function() { return 5; } })

Doesn't work, returns a mess of question marks:
dis("-r", function k(v) { return function() { return v; } })
Can trigger the bug without "-r", by using an escaping closure:
dis((function k(v) { return function() { return v; } })(4))

Looks like the "flags" and "upvars" sections got eaten.
Summary: dis("-r", fun) is broken when inner function has upvars → dis() is broken when function has upvars
2186	                if (script->bindings.hasUpvars()) {
2187	                    Sprint(sp, "\nupvars: {\n");
2188	
2189	                    void *mark = JS_ARENA_MARK(&cx->tempPool);
2190	                    jsuword *localNames = script->bindings.getLocalNameArray(cx, &cx->tempPool);
2191	                    if (!localNames)
2192	                        return false;

I suspect this nested arena-mark here is the problem.
OS: Mac OS X → All
Hardware: x86_64 → All
This is really being a PITA for debugging things....
Attached patch PatchSplinter Review
Try not to gag too much.
Assignee: general → jwalden+bmo
Status: NEW → ASSIGNED
Attachment #541977 - Flags: review?(mrbkap)
Attachment #541977 - Flags: review?(mrbkap) → review+
http://hg.mozilla.org/tracemonkey/rev/b79cf02287c6
Whiteboard: fixed-in-tracemonkey
Target Milestone: --- → mozilla7
Status: ASSIGNED → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Target Milestone: mozilla7 → mozilla8
No longer depends on: 682616
Target Milestone: mozilla8 → mozilla7
Filter on qa-project-auto-change:

Bug in removed tracer code, setting in-testsuite- flag.
Flags: in-testsuite-
You need to log in before you can comment on or make changes to this bug.