IntersectMBO / plutus

The Plutus language implementation and tools
Apache License 2.0
1.57k stars 479 forks source link

Plutus-core overflows for values allowed by the specification #96

Closed nishantjr closed 6 years ago

nishantjr commented 6 years ago

The spec allows integers with size 1 as large as 127, but the reference implementation overflows at just 4.

$ cat overflow.plc
(program 0.1.0 (con 1 ! 4))
$ cat overflow.plc | language-plutus-core-run-ck
Integer overflow at 1:21.
effectfully commented 6 years ago

I fixed this a while ago. You're using an old executable. Now the correct command is

echo "(program 0.1.0 [(lam x [(con integer) (con 2)] x) (con 2 ! 4)])" | plc evaluate --stdin

We updated the README, but we also should have warned you about the changes. Sorry about that.

Please confirm plc evaluate --stdin works correctly and I'll close this.

lucaspena commented 6 years ago

Yes, sorry, thanks for the update. We were still using language-plutus-core-run-ck. It all works now with plc evaluate --stdin.

effectfully commented 6 years ago

Cool.