Skip to content

Conversation

jserv
Copy link
Collaborator

@jserv jserv commented Sep 3, 2025

Variables modified through pointers incorrectly returned cached constant values instead of reloading from memory. This caused wrong results when a variable was initialized with a constant, had its address taken, and was modified through pointer indirection.

Example that was broken:

int b = 10;
int *a = &b;
a[0] = 5;
return b;

Previously returned 10 (cached), now correctly returns 5 (reloaded).

@jserv jserv requested a review from vacantron September 3, 2025 01:07
Variables modified through pointers incorrectly returned cached constant
values instead of reloading from memory. This caused wrong results when
a variable was initialized with a constant, had its address taken, and
was modified through pointer indirection.

Example that was broken:
  int b = 10;
  int *a = &b;
  a[0] = 5;
  return b;

Previously returned 10 (cached), now correctly returns 5 (reloaded).
@jserv jserv merged commit 1611d23 into master Sep 3, 2025
12 checks passed
@jserv jserv deleted the pointer-aliasing branch September 3, 2025 01:17
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