jon
Converser

Posts: 10
|
Post by jon on May 1, 2021 17:32:03 GMT
I think I found a bug:
if load sub test2 x0 log test2 x0 end sub test1 x0 log test1 x0 test2 x0 end
test1 0 # works as expected test1 # crashes streambyter end
|
|
jon
Converser

Posts: 10
|
Post by jon on May 1, 2021 17:59:59 GMT
Same result if Z array used instead of named parms
if load sub test2 log test2 z0 end sub test1 log test1 z0 test2 z0 end
test1 0 # works as expected test1 # crashes streambyter end
|
|
|
Post by uncledave on May 1, 2021 21:42:01 GMT
Right. It's actually the call to test2 x0, when x0 is undefined, that triggers the error. SB crashes with a SIGSEGV (bad address). It does not appear to depend on iOS version. I see the same results on iPadOS 14.5 and on iOS 12.5.2. I guess the advice would be "don't do this".
|
|
jon
Converser

Posts: 10
|
Post by jon on May 3, 2021 15:28:22 GMT
Yeah I guess it's pretty easy to avoid once you know, but it does feel less elegant to be forced to code in a placeholder parameter in every call when it was intended to be optional.
|
|
|
Post by uncledave on Mar 24, 2022 17:43:56 GMT
Dang it! I just experienced my own version of this. The Sub originally had no parameters, then one was added, but one of the calls was not updated. It works if you copy the parameter to another variable, and pass that to the second Sub. Took a while to track down, because I had a slew of working code. Adding the call to a second Sub with the parameter triggered the SIGSEGV for no apparent reason.
|
|