HaxeFoundation/hashlink

Hashlink access violation/segfault, when abstract is used as inerface

neimanpinchas opened this issue · 0 comments

Posted on forum here https://community.haxe.org/t/hashlink-access-violation-when-abstract-is-used-as-inerface/4250
On thx fponticelli/thx.core#289
haxe try https://try.haxe.org/#33718600
GIthub repo to reproduce https://github.com/neimanpinchas/hashlink_fix/tree/main

Possibly related: #685

Altough I hope to find a temporary workaround, I believe that it is in hashlinks interest to become compatiable with the other targets so I am making an issue here to track it, sorry if I have been annoying anyone.

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.

To my wonder, while trying to make a reroducable example, I bumped into another bug, to be sure I’ve tested it with neko and cpp both are working fine, hashlink is the outlier in both cases.