arturo-lang / arturo

Simple, expressive & portable programming language for efficient scripting
http://arturo-lang.io
MIT License
673 stars 29 forks source link

[Io\print] `print` segfaults when trying to print `:bytecode`'s `data` field #1627

Open RickBarretto opened 1 month ago

RickBarretto commented 1 month ago

To Reproduce

antiprimes.art:

btc: to :bytecode [
  found: 0
  i: 1
  maxDiv: 0

  while [found < 20] [
    fac: size factors i
    if fac > maxDiv [
      print i
      maxDiv: fac
      found: found + 1
    ]
    i: i + 1
  ]
]

do btc

print "============"

print btc\data

On terminal:

$ arturo antiprimes.art
1
2
4
6
12
24
36
48
60
120
180
240
360
720
840
1260
1680
2520
5040
7560
============
SIGSEGV: Illegal storage access. (Attempt to read from nil?)

Expected behavior

As for inspect, print should work as well:

image

$ arturo antiprimes.art
1
2
4
6
12
24
36
48
60
120
180
240
360
720
840
1260
1680
2520
5040
7560
============
[found i maxDiv 20 factors fac]

Desktop (please complete the following information):

Additional context I discovered when talking about a possible bug with bytecode\data