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

"Stack & PRE" error #47

Open
myCrack opened this issue Aug 19, 2020 · 2 comments
Open

"Stack & PRE" error #47

myCrack opened this issue Aug 19, 2020 · 2 comments

Comments

@myCrack
Copy link
Contributor

myCrack commented Aug 19, 2020

# test.mpl

pfunc: [{PRE:CALL:;;}];
fact: [[] [0 .Fail] uif];

f: [];
f: [_:; 0 .Abort] [0 .DoNothing] pfunc;

(f) ()     # Two empty lists.
printStack # Stack depth must be 2.
same fact  # Two empty lists must be the same, so this check must not fail.
> mplc -version && mplc test.mpl
MPL compiler version 200817 debug
stack:
depth=1
{}'RT
test.mpl(4,14): error, [.Fail], not a combined
test.mpl(11,6): [fact], called from here
test.mpl(1,1): [], called from here

As we can see from the comments and the output - the compilation didn't turn out the way we expected.

TarasBereznyak added a commit that referenced this issue Aug 21, 2020
TarasBereznyak added a commit that referenced this issue Aug 21, 2020
@MatwayBurkow
Copy link
Member

Not reproducible in 200821.

>mplc -version && mplc test.mpl
MPL compiler version 200821 debug
stack:
depth=2
{}'RT
{}'RT

@myCrack
Copy link
Contributor Author

myCrack commented Aug 21, 2020

We have another error - list's items leak:

# test.mpl

pfunc: [{PRE:CALL:;;}];
fact: [[] [0 .Fail] uif];

f: [42];
f: [_:; 0 .Abort] [0 .DoNothing] pfunc;

(f) (42)   # Two non-empty lists.
printStack # Stack depth must be 2.
same fact
> mplc -version && mplc test.mpl
MPL compiler version 200821 debug
stack:
depth=3
{:i32;}RT
{}'RT
i32CT static: 42
test.mpl(4,14): error, [.Fail], not a combined
test.mpl(11,6): [fact], called from here
test.mpl(1,1): [], called from here

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

No branches or pull requests

2 participants