Closed Bug 1339986 Opened 7 years ago Closed 7 years ago

Assertion failure: isString() with modules and export*

Categories

(Core :: JavaScript Engine, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla54
Tracking Status
firefox54 --- fixed

People

(Reporter: anba, Assigned: anba)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

Test case:
---
parseModule(`
export * from './t.js';
export let foo;
`);
---


Stacktrace:
---
#0  0x000000000045d2dd in JS::Value::toString() const (this=0x7fffffffaae0) at /home/andre/hg/mozilla-inbound/js/src/build-debug-obj/dist/include/js/Value.h:624
#1  0x00000000005d0619 in js::ExportEntryObject::exportName() const (this=(const js::ExportEntryObject * const) 0x7ffff17003a0 [object ExportEntry])
    at /home/andre/hg/mozilla-inbound/js/src/builtin/ModuleObject.cpp:150
#2  0x00000000005d63fd in js::ModuleBuilder::hasExportedName(JSAtom*) const (this=0x7fffffffb0f0, name="foo") at /home/andre/hg/mozilla-inbound/js/src/builtin/ModuleObject.cpp:1249
#3  0x00000000004c28a4 in js::frontend::Parser<js::frontend::FullParseHandler>::checkExportedName(JSAtom*) (this=0x7fffffffbdf8, exportName="foo")
    at /home/andre/hg/mozilla-inbound/js/src/frontend/Parser.cpp:4895
#4  0x00000000004c2aa1 in js::frontend::Parser<js::frontend::FullParseHandler>::checkExportedNamesForDeclaration(js::frontend::ParseNode*) (this=0x7fffffffbdf8, node=0x7ffff69fd140)
    at /home/andre/hg/mozilla-inbound/js/src/frontend/Parser.cpp:4923
#5  0x00000000004c3bc9 in js::frontend::Parser<js::frontend::FullParseHandler>::exportDeclaration() (this=0x7fffffffbdf8) at /home/andre/hg/mozilla-inbound/js/src/frontend/Parser.cpp:5205
#6  0x00000000004d4ddd in js::frontend::Parser<js::frontend::FullParseHandler>::statementListItem(js::frontend::YieldHandling, bool) (this=0x7fffffffbdf8, yieldHandling=js::frontend::YieldIsKeyword, canHaveDirectives=false) at /home/andre/hg/mozilla-inbound/js/src/frontend/Parser.cpp:7223
#7  0x00000000004d67fb in js::frontend::Parser<js::frontend::FullParseHandler>::statementList(js::frontend::YieldHandling) (this=0x7fffffffbdf8, yieldHandling=js::frontend::YieldIsKeyword)
    at /home/andre/hg/mozilla-inbound/js/src/frontend/Parser.cpp:3862
#8  0x00000000004bf391 in js::frontend::Parser<js::frontend::FullParseHandler>::moduleBody(js::frontend::ModuleSharedContext*) (this=0x7fffffffbdf8, modulesc=0x7fffffffb070)
    at /home/andre/hg/mozilla-inbound/js/src/frontend/Parser.cpp:2047
#9  0x0000000000c8817f in BytecodeCompiler::compileModule() (this=0x7fffffffb7a0) at /home/andre/hg/mozilla-inbound/js/src/frontend/BytecodeCompiler.cpp:396
#10 0x0000000000c88f10 in js::frontend::CompileModule(JSContext*, JS::ReadOnlyCompileOptions const&, JS::SourceBufferHolder&, js::LifoAlloc&, js::ScriptSourceObject**) (cx=0x7ffff696c000, optionsInput=..., srcBuf=..., alloc=..., sourceObjectOut=0x0) at /home/andre/hg/mozilla-inbound/js/src/frontend/BytecodeCompiler.cpp:597
#11 0x0000000000c88fed in js::frontend::CompileModule(JSContext*, JS::ReadOnlyCompileOptions const&, JS::SourceBufferHolder&) (cx=0x7ffff696c000, options=..., srcBuf=...)
    at /home/andre/hg/mozilla-inbound/js/src/frontend/BytecodeCompiler.cpp:608
#12 0x0000000000448c05 in ParseModule(JSContext*, unsigned int, JS::Value*) (cx=0x7ffff696c000, argc=1, vp=0x7ffff1330090) at /home/andre/hg/mozilla-inbound/js/src/shell/js.cpp:4082
...
---
Blocks: 1308159
Attached patch bug1339986.patchSplinter Review
exportName is null when ModuleBuilder::appendExportFromEntry() is called for export* declarations, so we need to change accessor method to handle this case.

I've verified that the previously failing test262 no longer raise an assertion error with this change.
Assignee: nobody → andrebargull
Status: NEW → ASSIGNED
Attachment #8839940 - Flags: review?(jcoppeard)
Comment on attachment 8839940 [details] [diff] [review]
bug1339986.patch

Review of attachment 8839940 [details] [diff] [review]:
-----------------------------------------------------------------

Great, thanks for fixing.
Attachment #8839940 - Flags: review?(jcoppeard) → review+
Pushed by ryanvm@gmail.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/746252fb0cbc
Handle export* when checking for duplicate export. r=jonco
Keywords: checkin-needed
https://hg.mozilla.org/mozilla-central/rev/746252fb0cbc
Status: ASSIGNED → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla54
You need to log in before you can comment on or make changes to this bug.