I don't normally debug other people's programs for them but this rather
intrigued me. The usual solution is to use Poly/ML's source-level debugger:
PolyML.Compiler.debug := true;
PolyML.Debug.breakEx Overflow;
use "your test";
When I tried it this didn't actually help which surprised me and
suggests that something needs to be done to improve the debugger. The
problem actually was that you redefine Int32 as Int but only AFTER you
have defined LiteralData and captured the old definition. That results
in an overflow in a line that reads:
val maxsmallnum = LiteralData.fromInt (getOpt (Int.maxInt, 0xffff))
David
On 16/05/2019 03:40, Jair Wang wrote:
Hi Poly/ML members:
I’m porting MLPolyR from SML/NJ to Poly/ML, and after getting
smlnj-lib, ml-yacc and ml-lex loaded with Poly/ML I try to load the
parser but the following error occurs:
```
Exception- Overflow raised
Exception- Overflow raised
```
and `poly` quits.
Here's a minimal setup that can reproduce the issue:
https://github.com/owo-lang/MLPolyR/tree/polyml_debug
Clone the tree and checkout `polyml_debug` branch,
```
poly --use load.sml
```
It already contains smlnj-lib, ml-yacc and ml-lex from MLton 20180207
releases.
My platform is macOS Mojave 10.14.4, Poly/ML version is 5.8 Release.
With the same setup MLton can compile the source without such an
issue. (via `mlton mlpolyr.mlb`)
Hints on what could be the cause?
Thank you for any help you can offer.
LdBeth.
_______________________________________________
polyml mailing list
polyml@inf.ed.ac.uk
http://lists.inf.ed.ac.uk/mailman/listinfo/polyml
_______________________________________________
polyml mailing list
polyml@inf.ed.ac.uk
http://lists.inf.ed.ac.uk/mailman/listinfo/polyml