thx.core icon indicating copy to clipboard operation
thx.core copied to clipboard

Access violation in haxe

Open neimanpinchas opened this issue 1 year ago • 1 comments

Not sure if this is hashlink or thx related

posted there https://community.haxe.org/t/hashlink-access-violation-when-abstract-is-used-as-inerface/4250

I am suffeing from a Access Violation error in hashlink. In thx.core

Big.hx public function multiply(that:BigIntImpl):BigIntImpl { if (that.isZero()) //<--- Excpetion here return Small.zero; return that.isSmall ? multiplySmall(cast that) : multiplyBig(cast that); } BigIntImpl is a interface, and that is a BigInt abstract backed by the BigIntImpl, the method is being invoked by the * operator torough the abstract.

The base class is Big which extens BigIntImpl.

When I check it in the hashlink debugger it seems like that is now a simple int array hashlink debugger says Unknown value isZero.

How can I get past such a problem?

neimanpinchas avatar Jun 05 '24 18:06 neimanpinchas

When I wrote thx.core I do not believe hashlink existed yet so it has definitely not being tested there. I have not used Haxe for a minute. If you figure it out I will certainly merge a PR.

fponticelli avatar Jun 06 '24 02:06 fponticelli

Hi

Please see the following

https://github.com/HaxeFoundation/hashlink/issues/688#issuecomment-2245649651

Would you accept a fix that removes the inline keword? we could do #if !hl

neimanpinchas avatar Jul 25 '24 10:07 neimanpinchas

Of course, I like the conditional inline idea, feel free to make a PR for it.

fponticelli avatar Jul 25 '24 14:07 fponticelli