Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[cppia][jit] terminate called after throwing an instance of 'Dynamic' #1169

Open
flashultra opened this issue Dec 23, 2024 · 1 comment
Open

Comments

@flashultra
Copy link

Running the following project ( under Linux or Mac only, it works on Win ) with haxelib run hxcpp script.cppia -jit will lead to the error terminate called after throwing an instance of 'Dynamic' . Everything works on Windows or without -jit option

Test project:
cppia_test.zip

  1. Compile with haxe build.hxml
  2. Run with haxelib run hxcpp script.cppia -jit
@flashultra
Copy link
Author

flashultra commented Jan 10, 2025

Here is very minimal example ( with two classes only)

Example : https://try.haxe.org/#B1Ad87Fd

BigIntTest .hx

class BigIntTest {

	static function main() {
		var value:String = "0x123456789abcdef0";
		var result = new MutableBigInt();
		if (StringTools.startsWith(value, "0x")) {
		    value = value.substr(2);
			result.setFromHex(value);
		}
	}
}

MutableBigInt.hx

import haxe.ds.Vector;

class MutableBigInt {
	public var m_data:Vector<Int>;
	
	public function new():Void {}

	public function setFromHex(value:String):Void {
		m_data = new Vector<Int>(4);
		for (i in 0...4) {
			m_data.set(i, 0);
		}
	}
}

The problem is only on Linux/Mac with cppia -jit option

Error:

terminate called after throwing an instance of 'Dynamic'
Aborted

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant