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

Support setjmp and longjmp? #89

Open
rinon opened this issue May 2, 2019 · 3 comments
Open

Support setjmp and longjmp? #89

rinon opened this issue May 2, 2019 · 3 comments
Labels
enhancement New feature or request

Comments

@rinon
Copy link
Contributor

rinon commented May 2, 2019

Although we are unlikely to support it in the near future, this issue will track any ideas and progress on supporting setjmp/longjmp.

@rinon rinon added the enhancement New feature or request label May 2, 2019
@XVilka
Copy link

XVilka commented Jun 7, 2019

You might employ "No more GOTOs" paper: https://net.cs.uni-bonn.de/fileadmin/ag/martini/Staff/yakdan/dream_ndss2015.pdf
It is even implemented (sort of) in radeco decompiler: https://github.com/radareorg/radeco/commits?author=HMPerson1

While it is not directly applicable, still quite relevant, and might give you ideas as well.

@rinon
Copy link
Contributor Author

rinon commented Jun 8, 2019

Thanks, I'm actually familiar with the paper. It only applies to transforming local (intra-function) control-flow. We use a variant on the Emscripten relooper algorithm (http://mozakai.blogspot.com/2012/05/reloop-all-blocks.html) to do a similar thing.

However, setjmp/longjmp can be used to transfer control across functions not just in the same function, so these techniques do not apply, at least not directly.

@bjorn3
Copy link

bjorn3 commented Aug 29, 2019

According to https://smallcultfollowing.com/babysteps/blog/2016/10/02/observational-equivalence-and-unsafe-code/ setjmp/longjmp is incompatible with the rayon crate, which provides safe scoped threads.

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

No branches or pull requests

3 participants