Skip to content

fix: values of local variables that are children of structs, arrays, bitfields or unions are set to invalid values when the setOffset() function of the parent is called.#174

Merged
paxcut merged 2 commits into
WerWolv:masterfrom
paxcut:LocalMemberVariablesIssue
Jul 1, 2025
Merged

Conversation

@paxcut
Copy link
Copy Markdown
Collaborator

@paxcut paxcut commented Jul 1, 2025

For example when a child of the Json built in data type is used as a reference argument to a function the values of the child and all its children become zero.

For those four pattern types setOffset() changes the offsets of all the children and if the children are local the offset is set to the offset of the parent pattern which leads to the incorrect values for the local variables when pattern is evaluated from then on.

The fix consists on removing the code that changes the offsets of local variables in the four (five?) setOffset() functions.

paxcut and others added 2 commits June 30, 2025 17:04
…bitfields or unions are set to invalid values when the setOffset() function of the parent is called.

 For example when a child of the Json built in data type is used as a reference argument to a function the values of the child and all its children become zero. For those four pattern types `setOffset()` changes the offsets of all the children and if the children are local the offset is set to the offset of the parent pattern which is clearly wrong. The fix consists on removing the code that changes the offsets of local variables in the four (five?) setOffset() functions.

 Also fixed unions using local variables to determine the pattern size.
@paxcut paxcut merged commit 3690ea4 into WerWolv:master Jul 1, 2025
4 checks passed
@paxcut paxcut deleted the LocalMemberVariablesIssue branch July 1, 2025 11:57
lawm pushed a commit to lawm/PatternLanguage that referenced this pull request Mar 13, 2026
…bitfields or unions are set to invalid values when the setOffset() function of the parent is called. (WerWolv#174)

For example when a child of the Json built in data type is used as a reference argument to a function the values of the child and all its children become zero. For those four pattern types `setOffset()` changes the offsets of all the children and if the children are local the offset is set to the offset of the parent pattern which is clearly wrong. The fix consists on removing the code that changes the offsets of local variables in the four (five?) setOffset() functions.

 Also fixed unions using local variables to determine the pattern size.
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