Skip to content

Strings with zeros inside are inconsistent between refc and other backends #3158

@buzden

Description

@buzden

Steps to Reproduce

Consider the following program

main : IO ()
main = do
  printLn $ String.length "ab"
  printLn $ String.length "a\0b"

and run is with different backends:

$ IDRIS2_CG=chez idris2 --exec main Main.idr
$ IDRIS2_CG=racket idris2 --exec main Main.idr
$ IDRIS2_CG=refc idris2 --exec main Main.idr
$ IDRIS2_CG=node idris2 --exec main Main.idr

Expected Behavior

All backends would give a consistent output, presumably

2
3

Observed Behavior

chez, racket and node give

2
3

and refc gives

2
1

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions