Fixed Missing Type Validation for Table Section issue #536
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
This pull request addresses missing table-related initializations in the InitDataSegments function of m3_env.c.
Previously, the code referenced non-existent fields (numTables, table0MaxSize) in the M3Module structure, which caused compilation errors.
Changes Made
Added explicit initialization and validation for table elements without relying on deprecated or missing fields.
Ensured that table element initialization aligns with the current M3Table structure design.
Improved error checking to prevent table index or size overflows during data segment initialization.
Reason for Change
The existing code referenced outdated structure members removed in newer versions of the wasm3 core.
This caused build failures and undefined behavior during table setup.
This fix ensures compatibility with the latest source and restores proper table initialization