-
Notifications
You must be signed in to change notification settings - Fork 72
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
Handle operations on the addresses of non-array types #1480
base: master
Are you sure you want to change the base?
Conversation
This reverts commit 3952a04.
…not only their types)
…struct ptr with an offset
I was satisfied with the fix that I proposed here, but I think @sim642 was unsure if it was the right fix for this. @michael-schwarz, could you please take a look at it? Do you think this fix is reasonable? |
begin match IdxDom.(to_bool (eq f_offset (neg (iDtoIdx n)))) with | ||
| Some true -> `NoOffset | ||
| _ when isArrayType f.ftype -> `Field (f, `Index (n, `NoOffset)) | ||
| _ when GobOption.exists (Z.equal Z.zero) (ID.to_int n) -> `NoOffset (* adding (or subtracting) 0 to any type of pointer is ok *) |
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.
As it stands this means that the case of n
being -f_offset
is handled the same as the case where n
is 0
?
That seems odd.
Would this not have to be Field(f,NoOffset)
here?
Solves #1421