Skip to content
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

fix confusion between GEP base type and return type #322

Merged
merged 1 commit into from
Oct 18, 2024
Merged

Conversation

Ptival
Copy link
Contributor

@Ptival Ptival commented Oct 18, 2024

The LLVM GEP instruction is notoriously confusing, and looks like this was yet another victim.

The base type of computation is the underlying pointee type of the pointer from which operations are being done.

The return type can be the same or something else, depending on what exactly is computed by the GEP operation.

The two were conflated here which was creating bugs. They are now distinct, with the base type being obtained from the operand (as it is easy to do), and the return type being provided by the caller (as it is otherwise annoying to computed from the operands).

The LLVM GEP instruction is notoriously confusing, and looks like this
was yet another victim.

The base type of computation is the underlying pointee type of the
pointer from which operations are being done.

The return type can be the same or something else, depending on what
exactly is computed by the GEP operation.

The two were conflated here which was creating bugs.  They are now
distinct, with the base type being obtained from the operand (as it is
easy to do), and the return type being provided by the caller (as it is
otherwise annoying to computed from the operands).
@Ptival Ptival merged commit 7948b66 into main Oct 18, 2024
2 checks passed
@Ptival Ptival deleted the vr/fix-gep branch October 18, 2024 15:42
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.

1 participant