Menu

#45 string-ref / vector-ref should negate is_integer check

tinyscheme-v1.43
closed-fixed
easy (2) bug (2)
2
2020-09-22
2020-09-22
No

Kevin, Hi!

Bug is only in trunk, after 1.42, introduced in rev 117

All is_integer checks in these 4 places should be negated.

To reproduce, run:

./scheme -c '(display (string-ref "bla" 1))(newline)'

In 1.42 it gives "l" in output, as expected, but in trunk it gives "Error: string-ref: index must be exact: 1 "

Fix seems easy - just adding "!" in all 4 places, as in attached patch.

Thanks for your efforts!

1 Attachments

Discussion

  • Kevin Cozens

    Kevin Cozens - 2020-09-22
    • status: open --> closed
    • Group: Future --> tinyscheme-v1.43
     
  • Kevin Cozens

    Kevin Cozens - 2020-09-22

    Thanks for catching this.

    r126 | kcozens | 2020-09-22 19:31:57 -0400 (Tue, 22 Sep 2020) | 3 lines

    Oops. The is_integer checks needed to be negated.
    Fixes bug #45. From a patch by Rodion Gorkovenko.

     
  • Kevin Cozens

    Kevin Cozens - 2020-09-22
    • status: closed --> closed-fixed
     

Log in to post a comment.

MongoDB Logo MongoDB