Skip to content

fix: forbid non-dollar names starting with $#816

Open
jodavies wants to merge 1 commit intoform-dev:masterfrom
jodavies:dollar-decl
Open

fix: forbid non-dollar names starting with $#816
jodavies wants to merge 1 commit intoform-dev:masterfrom
jodavies:dollar-decl

Conversation

@jodavies
Copy link
Copy Markdown
Collaborator

No description provided.

@coveralls
Copy link
Copy Markdown

Coverage Status

coverage: 58.431% (+0.001%) from 58.43%
when pulling c982339 on jodavies:dollar-decl
into c549571 on form-dev:master.

@tueda tueda linked an issue Apr 3, 2026 that may be closed by this pull request
@tueda
Copy link
Copy Markdown
Collaborator

tueda commented Apr 3, 2026

Strangely, I got the following Valgrind error with

Local $test = 1;
.end
FORM 5.0.0 (Mar 31 2026, v5.0.0-11-gc982339)     Run: Fri Apr  3 17:19:53 2026
    Local $test = 1;
test.frm Line 1 --> Illegal name for expression
==636271== Invalid read of size 4
==636271==    at 0x404FF3D: DoExpr (comexpr.c:251)
==636271==    by 0x40507EF: CoLocal (comexpr.c:66)
==636271==    by 0x4066E94: CompileStatement (compiler.c:696)
==636271==    by 0x4112B5A: PreProcessor (pre.c:1130)
==636271==    by 0x4154E3D: main (startup.c:1819)
==636271==  Address 0x4 is not stack'd, malloc'd or (recently) free'd
==636271==

But the Valgrind check in CI passed...?

@jodavies
Copy link
Copy Markdown
Collaborator Author

jodavies commented Apr 6, 2026

Right, I can reproduce that locally. The same thing happens with, for eg,

Local test_ = 1;
.end

It looks like AC.ProtoType is only set properly in the non-error branch -- it would be straightforward to simply return the error immediately upon finding a bad expression name?

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.

Compiler does not reject declarations of $-prefixed symbols

3 participants