Commit 3a091b8
authored
Fix an off-by-one error in the
```
jost@freshcode-1:$ kompile test.k
[Warning] Compiler: Could not find main syntax module with name TEST-SYNTAX in
jost@freshcode-1:$ krun -cPGM='Bytes2Int(b"\x00\x80", LE, Signed)'
<k>
-32768 ~> .K
</k>
jost@freshcode-1:$ kompile test.k --backend haskell
[Warning] Compiler: Could not find main syntax module with name TEST-SYNTAX in
definition. Use --syntax-module to specify one. Using TEST as default.
jost@freshcode-1:$ krun -cPGM='Bytes2Int(b"\x00\x80", LE, Signed)'
<k>
32768 ~> .K
</k>
```
32768 is not representable in 16 bit signed integers.
Root cause was a missing `=` , tests did not catch it because they
applied the same (wrong) logic as the conversion itself.Bytes2Int hook (#4095)1 parent 379cb61 commit 3a091b8
File tree
2 files changed
+35
-28
lines changed- kore
- src/Kore/Builtin
- test/Test/Kore/Builtin
2 files changed
+35
-28
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
529 | 529 | | |
530 | 530 | | |
531 | 531 | | |
532 | | - | |
| 532 | + | |
533 | 533 | | |
534 | 534 | | |
535 | 535 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
599 | 599 | | |
600 | 600 | | |
601 | 601 | | |
602 | | - | |
603 | | - | |
| 602 | + | |
| 603 | + | |
604 | 604 | | |
605 | | - | |
606 | | - | |
607 | | - | |
608 | | - | |
609 | | - | |
610 | | - | |
611 | | - | |
612 | | - | |
613 | | - | |
614 | | - | |
615 | | - | |
616 | | - | |
| 605 | + | |
| 606 | + | |
| 607 | + | |
| 608 | + | |
| 609 | + | |
| 610 | + | |
| 611 | + | |
| 612 | + | |
| 613 | + | |
| 614 | + | |
| 615 | + | |
| 616 | + | |
| 617 | + | |
| 618 | + | |
617 | 619 | | |
618 | 620 | | |
619 | 621 | | |
| |||
622 | 624 | | |
623 | 625 | | |
624 | 626 | | |
625 | | - | |
| 627 | + | |
626 | 628 | | |
627 | | - | |
| 629 | + | |
628 | 630 | | |
629 | 631 | | |
630 | 632 | | |
| |||
634 | 636 | | |
635 | 637 | | |
636 | 638 | | |
| 639 | + | |
| 640 | + | |
| 641 | + | |
| 642 | + | |
| 643 | + | |
| 644 | + | |
| 645 | + | |
| 646 | + | |
637 | 647 | | |
638 | 648 | | |
639 | 649 | | |
| |||
653 | 663 | | |
654 | 664 | | |
655 | 665 | | |
656 | | - | |
| 666 | + | |
657 | 667 | | |
658 | | - | |
| 668 | + | |
659 | 669 | | |
660 | 670 | | |
661 | | - | |
662 | | - | |
| 671 | + | |
| 672 | + | |
663 | 673 | | |
664 | | - | |
| 674 | + | |
665 | 675 | | |
666 | | - | |
667 | | - | |
668 | | - | |
669 | | - | |
670 | | - | |
671 | | - | |
672 | 676 | | |
| 677 | + | |
| 678 | + | |
| 679 | + | |
673 | 680 | | |
674 | 681 | | |
675 | 682 | | |
| |||
0 commit comments