Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

wasm loader: Fix pop invalid offset count when stack top is ANY #3516

Merged
merged 3 commits into from
Jun 14, 2024

Conversation

wenyongh
Copy link
Contributor

In wasm_loader_pop_frame_offset, when the stack is in polymorphic state
and the stack top operand is VALUE_TYPE_ANY, if we popping I64/F64
operand, we should pop one offset but not two offsets.

The issue was reported in #3513 and #3514.

@@ -10888,6 +10887,12 @@ wasm_loader_get_custom_section(WASMModule *module, const char *name,
}
#endif

#if 0
#define HANDLE_OPCODE(opcode) #opcode
DEFINE_GOTO_TABLE(const char *, op_mnemonics);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this mnemonics opcode table aimed to facilitate debugging in wasm_loader?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, in wasm_loader_prepare_bytecode, when traversing opcodes, we can print opcode name, e.g. printf("##%s\n", op_mnemonics[opcode]);.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks, got it

@TianlongLiang
Copy link
Contributor

LGTM

@wenyongh wenyongh merged commit d3e8989 into bytecodealliance:main Jun 14, 2024
378 checks passed
@wenyongh wenyongh deleted the fix_loader_issue branch June 26, 2024 03:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants