fponticelli / thx.core

Super-charged standard library for Haxe.
http://thx-lib.org
MIT License
124 stars 43 forks source link

Access violation in haxe #289

Closed neimanpinchas closed 3 months ago

neimanpinchas commented 5 months ago

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?

fponticelli commented 5 months ago

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.

neimanpinchas commented 3 months ago

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

fponticelli commented 3 months ago

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