Skip to content

lburg - fix strchr when buffer doesn't have an eol.#23

Open
ksherlock wants to merge 1 commit into
drh:masterfrom
ksherlock:lburg_no_eol
Open

lburg - fix strchr when buffer doesn't have an eol.#23
ksherlock wants to merge 1 commit into
drh:masterfrom
ksherlock:lburg_no_eol

Conversation

@ksherlock
Copy link
Copy Markdown

if strchr(bp, '\n') didn't find anything the first time, it won't find anything the second time, either.
Change to'\0' to find the end-of-line. It's still a syntax error (the grammar requires a '\n') but it won't cause an alloc error.

This is only an issue if there's no end-of-line while lexing a rule's cost code (so not a problem with any of lcc's files).

if strchr(bp, '\n') didn't find anything the first time, it won't find anything the second time, either.
Change to '\0' to find the end-of-line. It's still a syntax error (the grammar requires a '\n') but it won't cause an alloc error.
AJBats added a commit to AJBats/saturncc that referenced this pull request Apr 18, 2026
Six variants of the fixed-point 4x4 matrix-multiply pattern
(same inner arithmetic as drh#23, with different register/ptr
aliases). Adds DAT_06045070, PTR_DAT_06045074, DAT_060450e4,
PTR_DAT_060450e8 to shim.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
AJBats added a commit to AJBats/saturncc that referenced this pull request Apr 18, 2026
…ll assign relaxation

Bulk unwrap via scripted #if 0 removal for 21 functions. All are
variations on the same fixed-point matrix/vector primitives seen
in drh#23-drh#29, with occasional void-returning intra-TU callees
whose return value Ghidra still reads.

rcc fix (enode.c + expr.c): accept 'lhs = void_call(...)' by
treating a void-returning call as producing an int-sized value
in the SH-2 return register r0. Previously errored 'operands of =
have illegal types unsigned long and void' and hit a cast/btot
assertion for VOID src. Relaxation:
  - assign(): return lhs type when rhs is voidtype and lhs is
    arithmetic or pointer (before the size-zero early-exit).
  - cast(): VOID case rebuilds CALL trees with op = CALL+dst so
    codegen actually materializes a value.

Shim additions: pcRam060452{58,5c}, PTR_FUN_0604539c,
PTR_SUB_060453a0, PTR_DAT_060453a{4,c}, PTR_FUN_060453b4,
puRam060453c{0,4}, puRam0604559{4,8}, DAT_060455{ee,f0,fc},
DAT_06045{600,608,60c,610}, PTR_FUN_060455f{4,8}, PTR_LAB_06045604,
DAT_06045608 (code*), uRam060451f4, DAT_0604514c, PTR_DAT_06045150.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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