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

Do not scale array index down if it can't be divided by element size #1306

Merged
merged 2 commits into from
Dec 8, 2023

Conversation

ptomin
Copy link
Collaborator

@ptomin ptomin commented Dec 7, 2023

  • Create CEB test: pointer to struct with array field
    Expected: id->a0000[index]
    But was: id[index * 0x00000008<p32> / 32<i32>]
  • Do not scale array index down if it can't be divided by element size
    Avoid expressions like a[index / 9244].

Expected: "id->a0000[index]"
But was:  "id[index * 0x00000008<p32> / 32<i32>]"
@ptomin ptomin self-assigned this Dec 7, 2023
@ptomin ptomin added the bug This issue describes a defect in Reko label Dec 7, 2023
@ptomin ptomin requested a review from uxmal December 7, 2023 16:17
@uxmal
Copy link
Owner

uxmal commented Dec 8, 2023

You've been busy, Pavel. Nice improvements here.

@uxmal uxmal merged commit 48b0c03 into uxmal:master Dec 8, 2023
8 checks passed
@ptomin ptomin deleted the try-scale-down-index branch December 8, 2023 08:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue describes a defect in Reko
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants