Commit graph

11 commits

Author SHA1 Message Date
Eric Swanson
e42892fe7b Compiler v1 error messages in *.err1 files 2020-08-01 17:20:20 -07:00
Eric Swanson
13ba4ad940 Fix a bug in the legacy compiler .ecl output
The RSV_LOCAL offset should be the the local variable, not of the local variable within the block

Notice though, that the executor doesn't even use it.

There is more detail in the attached script.

listfile before:
/vagrant/testsuite/escript/bug/bug013-local-variable-index.src, Line 7
program foo()
var a;             // should be 0
0: decl local #0
1: #
if ( a )
2: local #0
3: if false goto 17
var b;         // should be 1    actually emitted 0
4: decl local #0
5: #
var c;         // should be 2    actually emitted 1
6: decl local #1
7: #
if ( b )
8: local #1
9: if false goto 16
var d;     // should be 3    actually emitted 0
10: decl local #0
11: #
print(d);
12: local #3
13: Func(1,0): Print
14: #
15: leave block(1)
16: leave block(2)
17: leave block(1)
18: progend

listfile after:
/vagrant/testsuite/escript/bug/bug013-local-variable-index.src, Line 7
program foo()
var a;             // should be 0
0: decl local #0
1: #
if ( a )
2: local #0
3: if false goto 17
var b;         // should be 1    actually emitted 0
4: decl local #1
5: #
var c;         // should be 2    actually emitted 1
6: decl local #2
7: #
if ( b )
8: local #1
9: if false goto 16
var d;     // should be 3    actually emitted 0
10: decl local #3
11: #
print(d);
12: local #3
13: Func(1,0): Print
14: #
15: leave block(1)
16: leave block(2)
17: leave block(1)
18: progend
2020-07-29 00:05:52 -07:00
turleypol
07f324040f
Merge pull request #149 from polserver/syz-fix-em-param-name-clash
Fix compiler bug with user function names that match module function argument names
2020-06-16 21:29:03 +02:00
Eric Swanson
e7733ccf19 Fix compiler bug: user functions should be able to have the same name as module function parameter names 2020-06-15 22:27:57 -07:00
Eric Swanson
fd6b722eaf Fix optimization error: will sometimes patch an offset of the wrong instruction when
rolling back an if statement branch.
2020-06-14 03:31:03 -07:00
Eric Swanson
252a4947ce Add bug010 - optimizer bug with if statements 2020-06-13 19:10:33 -07:00
Eric Swanson
51129732d1 Make it a compilation error to hit EOF while expecting an expression terminator (usually semicolon). 2020-06-10 22:14:31 -07:00
turleypol
e6f59a69a9 removed instructions testscript files they are not used
removed appveyor xml testresult (I'm to dumb)
2018-10-31 12:09:31 +01:00
Gabriele Tozzi
861ff58d1d Fixed: Minor bug in ecompile allowing Double in the form "2d4".
These were incorrectly interpreted as "2e4", meaning 20000 and
leading to confusion with dice rolls. The compiler now issues an
error instead.
Added related test cases.
2016-01-22 00:16:39 +01:00
Gabriele Tozzi
e085b218f6 Unit tests: full revision, now all run correctly
- Added missing ones
- Reviewed obsoleted ones
- Disabled/deleted unnecessary ones
- Added support for compile error checking
- Added support for run error checking
2015-12-19 05:31:23 +01:00
Gabriele Tozzi
0efeb4d379 Unit Tests: putting some orde rin escript unit tests 2015-12-19 02:31:08 +01:00