Samsung / walrus

WebAssembly Lightweight RUntime
Apache License 2.0
37 stars 10 forks source link

Bugfix #87

Closed GorogPeter closed 1 year ago

GorogPeter commented 1 year ago

Fixing condition and return value.

zherczeg commented 1 year ago

I don't think this is correct, since it removes the alignment requirement.

zherczeg commented 1 year ago

A bit more context: https://github.com/Samsung/walrus/blob/interp/src/parser/WASMParser.cpp#L899 The valueSizeInStack does not represent the size of the value which needs to be transferred. Hence, the if (sz == 4) is incorrect and m_result.m_globalTypes[index]->type() should be used to determine the size of the transfer.

The m_result.m_globalTypes[index]->type() could be moved to a local variable, and compared to Value::I32 or Value::F32.

GorogPeter commented 1 year ago

Thank you!