::super:new segfault in MacOS arm64

55 views
Skip to first unread message

Lorenzo Fiorini

unread,
Sep 17, 2025, 2:20:25 AM (13 days ago) Sep 17
to harbou...@googlegroups.com
Just to report that I got into a segfault with a code like this:

// test1.prg
#include "hbclass.ch"

class one
   var n
   var c
   method init
end class

method init(n, c) class one
   ::n := n
   ::c := c
return Self

class two from one
   method init
end class

method init(cMsg) class Two
   //::super:init(0, cMsg)  // this works
   ::super:new(0, cMsg) // this segfault
return Self

function main()
   local oOne := One():new(1, "yes")
   local oTwo := Two():new("no")
   outstd(hb_valtoexp(oOne), hb_eol())
   outstd(hb_valtoexp(oTwo), hb_eol())
   return nil

hbmk2 test1.prg

lldb ./test1
run
...
Process 93623 stopped
* thread #1, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (cod)
    frame #0: 0x0000000100013fc0 test1`hb_objGetMethod
test1`hb_objGetMethod:
->  0x100013fc0 <+0>:  stp    x28, x27, [sp, #-0x60]!
    0x100013fc4 <+4>:  stp    x26, x25, [sp, #0x10]
    0x100013fc8 <+8>:  stp    x24, x23, [sp, #0x20]
    0x100013fcc <+12>: stp    x22, x21, [sp, #0x30]
(lldb) 0: (test1) stopped.
Reply all
Reply to author
Forward
0 new messages