Skip to content

Commit fb99a4d

Browse files
committed
Fixed segmentation fault caused by accessing nonexistent child
1 parent 4585345 commit fb99a4d

File tree

5 files changed

+17
-1
lines changed

5 files changed

+17
-1
lines changed

.gitmodules

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,12 @@
1313
[submodule "benchmark/Javascript/microlight"]
1414
path = benchmark/Javascript/microlight
1515
url = https://github.com/asvd/microlight.git
16+
[submodule "benchmark/Javascript/mocha"]
17+
path = benchmark/Javascript/mocha
18+
url = https://github.com/mochajs/mocha.git
19+
[submodule "squish"]
20+
path = squish
21+
url = https://github.com/shgysk8zer0/squish.git
22+
[submodule "benchmark/Javascript/squish"]
23+
path = benchmark/Javascript/squish
24+
url = https://github.com/shgysk8zer0/squish.git

benchmark/Javascript/mocha

Submodule mocha added at d643105

benchmark/Javascript/squish

Submodule squish added at fd5e564

squish

Submodule squish added at fd5e564

src/tstool/dfbscan_extractor/Javascript/Javascript_NPD_extractor.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,10 @@ def is_global_source(self, global_declaration_node: Tree) -> bool:
6161
sibling = global_declaration_node.next_sibling
6262

6363
while sibling is not None:
64+
if len(sibling.children) == 0:
65+
sibling = sibling.next_sibling
66+
continue
67+
6468
expr = sibling.child(0)
6569

6670
if self.is_expression_delete(expr):
@@ -72,7 +76,7 @@ def is_global_source(self, global_declaration_node: Tree) -> bool:
7276
if self.is_expression_nullable(expr) and expr.child(0).text == global_name:
7377
return True
7478

75-
return False
79+
sibling = sibling.next_sibling
7680
return False
7781

7882
def is_global_sink(self, global_declarator_node: Tree) -> bool:

0 commit comments

Comments
 (0)