Skip to content

Support multi-symbol replace_load correctly#1366

Merged
vladmos merged 2 commits intobazelbuild:mainfrom
sbarfurth:sbarfurth/fix_replace_load_multiple_same_loc
Jul 3, 2025
Merged

Support multi-symbol replace_load correctly#1366
vladmos merged 2 commits intobazelbuild:mainfrom
sbarfurth:sbarfurth/fix_replace_load_multiple_same_loc

Conversation

@sbarfurth
Copy link
Contributor

The logic for removing old loading symbols replaced by replace_load was flawed. It would leave behind old (redundant) loads, iff the replace_load was to replace two symbols from the same location. This change simplifies how loads are replaced by simply keeping track of non-replaced loads rather than trying to remove from the list with index manipulation.

I've added a few more test cases. Most of these new tests will fail on the old code.

The logic for removing old loading symbols replaced by `replace_load` was flawed. It would leave behind old (redundant) loads, iff the `replace_load` was to replace two symbols from the same location. This change simplifies how loads are replaced by simply keeping track of non-replaced loads rather than trying to remove from the list with index manipulation.

I've added a few more test cases. Most of these new tests will fail on the old code.
@sbarfurth
Copy link
Contributor Author

Should I be requesting a review from someone else? @vladmos @pmbethe09 @oreflow

Copy link
Member

@vladmos vladmos left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@vladmos vladmos merged commit fdc6268 into bazelbuild:main Jul 3, 2025
2 checks passed
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.

2 participants