-
Notifications
You must be signed in to change notification settings - Fork 745
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
[PostEmscripten] Fix calcSegmentOffsets for large offsets #6260
Conversation
I'm not sure it worth writing a test for this.. maybe you can suggest a way if you feel like it needs one. This bug is currently preventing some of the "2gb" tests in emscripten from running (where static data segments are >2Gb in the 32-bit space) |
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.
In wasm64 don't these need to be 64-bit?
The Address being assigned to here is 64-bit or 32-bit accordingly, that is not the problem.. The bug being fixed here only occurs when on wasm32 when the value being read is is > 2&32. Prior to this change the |
@@ -317,7 +316,7 @@ struct PostEmscripten : public Pass { | |||
// The first operand is the function pointer index, which must be | |||
// constant if we are to optimize it statically. | |||
if (auto* index = curr->operands[0]->dynCast<Const>()) { | |||
size_t indexValue = index->value.getInteger(); |
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 is just a drive by fix, that I noticed while fixing the line above.
Function pointer are also unsigned values.
c5a7893
to
512738f
Compare
I added a test! |
512738f
to
94c15eb
Compare
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.
I see now, thanks. lgtm % question about the test.
Specifically offsets larger than 2^32 which were being interpreted misinterpreted here as very large int64_t values.
94c15eb
to
715513b
Compare
…y#6260) Specifically offsets larger than 2^32 which were being interpreted misinterpreted here as very large int64_t values.
Specifically offsets larger than 2^32 which were being interpreted misinterpreted here as very large int64_t values.