Skip to content

Commit 2622a27

Browse files
author
Suwei Chen
committed
[MERGE #3111 @suwc] Issue3076: Assertion Failure in Parsing
Merge pull request #3111 from suwc:build/suwc/Issue3076 Assertion is triggered in parse.cpp on this->m_deferringAST when CreateCallNode() is called in ParseImportCall(). Fix by adding check for buildAST.
2 parents a4bdc54 + 634b4eb commit 2622a27

File tree

3 files changed

+18
-1
lines changed

3 files changed

+18
-1
lines changed

lib/Parser/Parse.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2449,7 +2449,7 @@ template<bool buildAST> ParseNodePtr Parser::ParseImportCall()
24492449
}
24502450

24512451
m_pscan->Scan();
2452-
return CreateCallNode(knopCall, CreateNodeWithScanner<knopImport>(), specifier);
2452+
return buildAST ? CreateCallNode(knopCall, CreateNodeWithScanner<knopImport>(), specifier) : nullptr;
24532453
}
24542454

24552455
template<bool buildAST>

test/es6/bug_issue_3076.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
//-------------------------------------------------------------------------------------------------------
2+
// Copyright (C) Microsoft. All rights reserved.
3+
// Licensed under the MIT license. See LICENSE.txt file in the project root for full license information.
4+
//-------------------------------------------------------------------------------------------------------
5+
6+
function test() {
7+
import('passmodule.js');
8+
}
9+
10+
test();

test/es6/rlexe.xml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1419,6 +1419,13 @@
14191419
<tags>BugFix</tags>
14201420
</default>
14211421
</test>
1422+
<test>
1423+
<default>
1424+
<files>bug_issue_3076.js</files>
1425+
<compile-flags>-force:deferparse</compile-flags>
1426+
<tags>BugFix</tags>
1427+
</default>
1428+
</test>
14221429
<test>
14231430
<default>
14241431
<files>typedarray_bugs.js</files>

0 commit comments

Comments
 (0)