Skip to content

Conversation

@xujuntwt95329
Copy link
Collaborator

No description provided.

Comment on lines 346 to 347
if (address + (wait64 ? 8 : 4) > aot_memory->memory_data_end.ptr) {
wasm_runtime_set_exception(module, "out of bounds memory access");
Copy link
Collaborator

Choose a reason for hiding this comment

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

Failed to compile on Windows, and should check address < memory_data:

        if ((uint8 *)address < (uint8 *)aot_memory->memory_data.ptr
            || (uint8 *)address + (wait64 ? 8 : 4)
                   > (uint8 *)aot_memory->memory_data_end.ptr) {
            wasm_runtime_set_exception(module, "out of bounds memory access");
            return -1;
        }

Comment on lines 329 to 331
if ((uint8 *)address + (wait64 ? 8 : 4)
> module_inst->memories[0]->memory_data_end) {
wasm_runtime_set_exception(module, "out of bounds memory access");
Copy link
Collaborator

Choose a reason for hiding this comment

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

Should also check whether address < memory_data:

        if ((uint8 *)address < module_inst->memories[0]->memory_data
            || (uint8 *)address + (wait64 ? 8 : 4)
                   > module_inst->memories[0]->memory_data_end) {
            wasm_runtime_set_exception(module, "out of bounds memory access");
            return -1;
        }

Comment on lines 439 to 442
if ((uint8 *)address + 4 > module_inst->memories[0]->memory_data_end) {
wasm_runtime_set_exception(module, "out of bounds memory access");
return -1;
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

        if ((uint8 *)address < module_inst->memories[0]->memory_data
            || (uint8 *)address + 4
                   > module_inst->memories[0]->memory_data_end) {
            wasm_runtime_set_exception(module, "out of bounds memory access");
            return -1;
        }

Comment on lines 450 to 453
if (address + 4 > aot_memory->memory_data_end.ptr) {
wasm_runtime_set_exception(module, "out of bounds memory access");
return -1;
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

        if ((uint8 *)address < (uint8 *)aot_memory->memory_data.ptr
            || (uint8 *)address + 4
                   > (uint8 *)aot_memory->memory_data_end.ptr) {
            wasm_runtime_set_exception(module, "out of bounds memory access");
            return -1;
        }

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Done, thanks~

@wenyongh wenyongh merged commit 826cf4f into bytecodealliance:main Oct 13, 2022
vickiegpt pushed a commit to vickiegpt/wamr-aot-gc-checkpoint-restore that referenced this pull request May 27, 2024
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