Skip to content

Fix/list operations and compiler safety - #162

Open
t0mg wants to merge 3 commits into
JBenda:masterfrom
t0mg:fix/list-operations-and-compiler-safety
Open

Fix/list operations and compiler safety#162
t0mg wants to merge 3 commits into
JBenda:masterfrom
t0mg:fix/list-operations-and-compiler-safety

Conversation

@t0mg

@t0mg t0mg commented Sep 4, 2026

Copy link
Copy Markdown

No description provided.

@github-actions

github-actions Bot commented Sep 4, 2026

Copy link
Copy Markdown

Ink Proof Results

These results are obtained by running the Ink-Proof Testing Suite on the compiled binaries in this pull request.

System Results
Linux x64 130/130 passed
MacOSX-ARM DISABLED
MacOSX DISABLED
Windows x64 130/130 passed

@JBenda

JBenda commented Sep 4, 2026

Copy link
Copy Markdown
Owner

Thanks for the PR.
You found some serious bugs inside the table code. 👍
I will take a second look at the changes and will merge it soon™.

@t0mg
t0mg force-pushed the fix/list-operations-and-compiler-safety branch from 2e234cb to 4205e66 Compare September 4, 2026 13:00
@t0mg

t0mg commented Sep 4, 2026

Copy link
Copy Markdown
Author

Cool. I have a couple more PRs in stock but I'll wait for this one to land to make sure I'm doing it right.

t0mg and others added 3 commits September 7, 2026 15:00
…r safety

- Fix not_equal() in list_table: was returning equal(lh, rh)
- Fix list comparisons (less, greater, less_equal, greater_equal) to compare
  assigned integer flag values rather than internal declaration indices
- Fix LIST_VALUE evaluation to return get_flag_value() and support list operands
- Prevent list truncation at 255 elements by widening index mask to 0xFFFF
- Add bounds checking across listBegin(), hasList(), hasFlag(), and list iterators
- Fix use-after-free in compiler: named_list_flag now owns std::string
- Improve managed_array allocation safety with std::nothrow and nullptr guards
…risons

- list_impl.cpp: mask flag index with 0x7FFF instead of 0xFFFF: no negative flag by accident
- list_table.cpp: introduce found bool, since values could be negative
- list_table.h: rework less/greater/less_equal/greater_equal: no min/max -> empty list, empty list can be compared with
- stack.h: adapt print_dump() to tracing schema used in runner_impl.cpp
- list_table.h: fix include path ("include/list.h" -> "list.h"), "include" is defined as include path in `inkcpp/CMakeLists.txt`
@JBenda
JBenda force-pushed the fix/list-operations-and-compiler-safety branch from 4205e66 to 616e01e Compare September 7, 2026 13:03
@JBenda

JBenda commented Sep 7, 2026

Copy link
Copy Markdown
Owner

Hey, it took a while; I was double-checking the less/greater logic since empty lists are valid comparison targets (an empty list is smaller than a non-empty one, etc.)
Also modified print_dump() to reflect the the current print schema used in runner_impl.

Thanks again for uncovering those additional issues—looking forward to seeing what else you find.

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