-
Notifications
You must be signed in to change notification settings - Fork 271
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
amd64: fixes memory.fill bug #1055
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
(module | ||
(type (;0;) (func)) | ||
(func (;0;) (type 0) | ||
i32.const 1000 | ||
i32.const 1000 | ||
i32.const 1000 | ||
Comment on lines
+4
to
+6
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. seems like if these values exceed one byte range (>0xff) this happens, that's all I narrowed down! There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. interesting, the reason why the bug does not occur on aarch64 is less trivial than you may think. Maybe the spec is a bit unclear, because
if ProofI have dumped the contents of the memory buffer at 999:2001; on M1, for
we get the same on amd64. Now, let's set
which is obviously incorrect. But what happens instead on M1?
which is equal... because: (1) we are casting to byte in the interpreter
(2) on aarch64 (3) on amd64, the bug is only triggered for There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. so, the fix is to ensure that |
||
memory.fill | ||
) | ||
(memory (;0;) 1 2) | ||
(start 0) | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this out-of-bounds is due to how run() works. it is called up to two times, depending on if
platform.CompilerSupported()
so my guess is this test is only really going to do anything if
platform.CompilerSupported()
as that's the only time you'll have two modules. maybe guard on it?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
added at the top: