Skip to content

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
Collaborator

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
Collaborator

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
Collaborator

LGTM

@wenyongh wenyongh merged commit d3e8989 into bytecodealliance:main Jun 14, 2024
@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.

2 participants