Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ReplaceLoop(), If(FindLoop(...)) errors #578

Open
jodavies opened this issue Nov 14, 2024 · 1 comment
Open

ReplaceLoop(), If(FindLoop(...)) errors #578

jodavies opened this issue Nov 14, 2024 · 1 comment
Labels
bug Something isn't working
Milestone

Comments

@jodavies
Copy link
Collaborator

Syntax errors in these functions don't terminate FORM, so something like

Symbol x;
CFunction f,g,h;
Index i1,...,i3;

Local test =
	+ g(i1,i2)*g(i1,i2)
	+ g(i1,i2)*g(i1,i3)
	+ g(i1,i2,i3)*g(i1,i2,i3)
	+ h(i1,i2)*h(i1,i2)
	+ h(i1,i2)*h(i1,i3)
	+ h(i1,i2,i3)*h(i1,i2,i3)
	;

ReplaceLoop g, arguments=2, loopsize=2, outfun=f;
ReplaceLoop g, arguments=2, loopsize=2, outfun=f;
ReplaceLoop g, arguments=3, loopsize=2, outfun=f;

If (FindLoop(h, loopsize=1));
    Multiply x;
EndIf;

Print +s;
.end

produces nonsense.

compcomm.c:DoFindLoop should probably just Terminate at the syntax label, and goto it in all error cases and not just some of them.

@tueda
Copy link
Collaborator

tueda commented Nov 14, 2024

It seems that error = 1 is missing in DoFindLoop and CoIf (which calls CoFindLoop).

@tueda tueda added the bug Something isn't working label Nov 14, 2024
@tueda tueda added this to the v4.3.2 milestone Nov 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants