arturo-lang/arturo

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

RickBarretto opened this issue · 0 comments

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):

  • OS: Windows11
  • Arch: x86
  • Version: v/0.9.83 b/2898 @ 2024-05-04T20:31:34-03:00

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