You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
%jmp_buf = type { i32 }
declarei32@setjmp(%jmp_buf*%env)
declarevoid@longjmp(%jmp_buf*%env, i32%val)
definei32@main(i32%argc, i8**%argv) nounwind {
; "try" keyword expands to a call to @setjmp%env = alloca%jmp_buf%status = calli32@setjmp(%jmp_buf*%env)
%1 = icmpeqi32%status, 0bri1%1, label%.body, label%.catch_block
The LLVM docs on setjmp mentions that the single parameter to the setjmp intrinsic (i32 @llvm.eh.sjlj.setjmp(i8* %setjmp_buf)) is a pointer to a five word buffer in which the calling context is saved.
Following the documentation, shouldn't the size of jmp_buf be set to an array [5 x i32] ?
(assuming a 32-bit system)
Thank you for reading!
The text was updated successfully, but these errors were encountered:
It has been some years since I wrote that example and obviously it never ran. Or, if it ran, it must have been sheer luck :-) I don't know what went through my head, perhaps I just put in i32 with the intent of fixing it later and then forgot about it.
If you want to, you can submit a pull request with the fixed code.
Hello ,
first of all, thank you for sharing and maintaining this gitbook! 😄 😸
I noticed that in the setjmp/longjmp example code,
jmp_buf
is set and used as a singlei32
variable.The LLVM docs on setjmp mentions that the single parameter to the setjmp intrinsic (
i32 @llvm.eh.sjlj.setjmp(i8* %setjmp_buf)
) is a pointer to a five word buffer in which the calling context is saved.Following the documentation, shouldn't the size of
jmp_buf
be set to an array [5 x i32] ?(assuming a 32-bit system)
Thank you for reading!
The text was updated successfully, but these errors were encountered: