Skip to content

[cppia] exception is not thrown inside of while(true) #8915

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

Open
RealyUniqueName opened this issue Oct 31, 2019 · 3 comments
Open

[cppia] exception is not thrown inside of while(true) #8915

RealyUniqueName opened this issue Oct 31, 2019 · 3 comments
Assignees
Labels
bug platform-cpp Everything related to CPP / C++
Milestone

Comments

@RealyUniqueName
Copy link
Member

class Main {
	static public function main() {
		function loop() {
			while(true) {
				exit();
				continue;
			}
		}
		try {
			loop();
		} catch(e:String) {
			trace('ok');
		}
	}

	static function exit() {
		throw 'exit';
	}
}

Hangs forever at runtime with cppia

@RealyUniqueName RealyUniqueName added bug platform-cpp Everything related to CPP / C++ labels Oct 31, 2019
@RealyUniqueName RealyUniqueName added this to the Bugs milestone Oct 31, 2019
@Simn
Copy link
Member

Simn commented Oct 31, 2019

Is the dump correct?

@RealyUniqueName
Copy link
Member Author

Yes. Here's dump=pretty:

@:keep @:used
class Main {

	@:keep
	public static function main() {
		var loop = function() {
			while ((true)) {
				Main.crash();
				continue;
			};
		};
		try {
			loop();
		} catch (e:String) {
			haxe.Log.trace("ok!", {fileName : "src/Main.hx", lineNumber : 31, className : "Main", methodName : "main"});
		};
	}

	static function crash() {
		throw "wtf";
	}
}

@tobil4sk
Copy link
Member

This issue was moved to HaxeFoundation/hxcpp#876 and was fixed with: HaxeFoundation/hxcpp#1188, so this can be closed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug platform-cpp Everything related to CPP / C++
Projects
None yet
Development

No branches or pull requests

4 participants