[Super Z] Fix 3 critical bugs (MEMSET/MEMCMP/ADDI), 58 new tests (39→97)#2
Open
SuperInstance wants to merge 1 commit intomainfrom
Open
[Super Z] Fix 3 critical bugs (MEMSET/MEMCMP/ADDI), 58 new tests (39→97)#2SuperInstance wants to merge 1 commit intomainfrom
SuperInstance wants to merge 1 commit intomainfrom
Conversation
Bug fixes in src/vm.c: - Fix MEMSET: removed redundant memcpy(&n,data,4) that duplicated the address offset before the correct memcpy(&n,data+4,4) - Fix MEMCMP: changed memcpy(&b,data,4) to memcpy(&b,data+4,4) so 'b' reads from correct offset instead of copying same addr as 'a' - Add ADDI (0x19) dispatch: opcode was defined in enum but fell to default INVALID_OPCODE error; now properly adds signed imm16 to GPR[rd] Other fixes: - Add missing #include <stdlib.h> in src/main.c for malloc/free - Update Makefile with new test targets and clean rules New test files (58 tests total): - tests/test_float.c (17 tests): FADD, FSUB, FMUL, FDIV, FNEG, FABS, FMIN, FMAX, FEQ, FLT, FLE, FGT, FGE, FDIV-by-zero, cast roundtrip, chained float operations - tests/test_extended.c (22 tests): ADDI (positive, negative, zero, chained, large imm), LOAD/STORE, SWAP, DUP, div-by-zero, mod-by-zero, MOV, TEST, OR, XOR, NOT, SHR, CMP_LT/GT/NE, LOAD8/STORE8 - tests/test_regions.c (19 tests): REGION_CREATE/DESTROY, heap read/write, CHECK_BOUNDS, BOX/UNBOX, CHECK_TYPE, RESOURCE ops, JLT/JGT, SETCC, LOOP, YIELD, DEBUG_BREAK All 97 tests pass (22+5+12+17+22+19=97).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Critical bug fixes and comprehensive test expansion for the FLUX C runtime:
3 Critical Bugs Fixed
58 New Tests (39→97)
Test Results: 97/97 — ALL PASSING
Super Z — Quartermaster Scout