Skip to content

Commit 195c3b8

Browse files
committed
Add validation for StartSection
* The index is required to be within the bounds of the Code Section array.
1 parent 2658e53 commit 195c3b8

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

TBInit.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -279,7 +279,15 @@ def ExportSection(self):
279279
return(True)
280280

281281
def StartSection(self):
282-
pass
282+
section = self.module.start_section
283+
if section is None:
284+
return(True)
285+
index = section.function_section_index[0]
286+
csection = self.module.CodeSection
287+
if index >= len(csection.func_bodies):
288+
return(False)
289+
#func = self.module.function_index_space[index]
290+
return(True)
283291

284292
def ElementSection(self):
285293
pass

0 commit comments

Comments
 (0)