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

<<X Y Z>> no longer works in z3 #18

Closed
DavidKinder opened this issue May 8, 2020 · 3 comments · Fixed by #19
Closed

<<X Y Z>> no longer works in z3 #18

DavidKinder opened this issue May 8, 2020 · 3 comments · Fixed by #19

Comments

@DavidKinder
Copy link
Owner

From Johan Berntsson:

I have discovered a bug in Inform6 and I want to ask if you can make sure that it is being fixed in a future upgrade.

I and some friends are making a new standard library for small computers (think Commodore 64) which is called PunyInform: https://github.com/johanberntsson/PunyInform We are testing this on both z3 and z5, while the Inform stdlib no longer works on z3. What I have discovered is that <> no longer works in z3. It doesn't return from the function as it is supposed to (the implicit rtrue isn't generated).

The problem is line 173 on states.c:
assemblez_4(call_zc, AO, AO2, AO3, AO4);
should instead be:
assemblez_4_to(call_zc, AO, AO2, AO3, AO4, temp_var1);

Since the temp_var1 is missing the next instruction (the rtrue) will be assumed to be a global variable location instead, so the rtrue is never executed, causing the problem (but only in z1-z3 of course; z5 etc works). I have recompiled the Inform compiler and confirmed that this change solves the problem.

I have attached the fixed and working states.c. Can you make sure that the fix finds its way into the official repository?
states.c.txt

@erkyrath
Copy link
Contributor

erkyrath commented May 8, 2020

I've verified this fix. Simple test case:

Constant Story "Minimal";
Constant Headline "^Headline.^";

[ Main;
	print "Hello.^";
	<Blorb 1 2>;
	print "More.^";
	<<Frotz 3 4>>;
	print "Should not reach here.^";
];

[ BlorbSub; ];
[ FrotzSub; ];

@erkyrath
Copy link
Contributor

erkyrath commented May 8, 2020

erkyrath@78d9953

erkyrath pushed a commit to erkyrath/Inform6 that referenced this issue May 13, 2020
as a Github PR!
@erkyrath
Copy link
Contributor

I rejiggered my github repo so it's a fork of yours, so now I can make PRs and everything. :)

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 a pull request may close this issue.

2 participants