srenatus opened PR #3086 from sr/c-api/add-trap-code-accessor
to main
:
Eventually this should be added to the wasmtime-go binding, addressing
https://github.com/bytecodealliance/wasmtime-go/issues/63.:question: How would this be tested, short of actually using it from a binding? Happy to add test cases, but I'm afraid I'll need some direction.
alexcrichton submitted PR review.
alexcrichton submitted PR review.
alexcrichton created PR review comment:
I think here it's ok to skip the
enum { .. }
wrapper, and I think the value of each#define
constant will need to be listed.
alexcrichton created PR review comment:
Could you leave a comment near
enum TrapCode
and its#[non_exhaustive]
that any additions should get added here too?
alexcrichton created PR review comment:
Could this describe a situation where
false
is returned? (e.g. the trap was originally created withwasmtime_trap_new
)
srenatus updated PR #3086 from sr/c-api/add-trap-code-accessor
to main
.
srenatus submitted PR review.
srenatus created PR review comment:
Oops, I had a bunch of
#define
s first, then decided to model this after the config enums like...and didn't follow through properly :grimacing: I've updated the code using a proper enum instead of defines. What do you think?
srenatus submitted PR review.
srenatus created PR review comment:
Yup will do
alexcrichton submitted PR review.
alexcrichton created PR review comment:
Eh I could go either way, I don't actually know enough about C to know whether these are really that different, and they feel like the same to me. I'm happy to defer to whichever you feel is more appropriate here!
srenatus updated PR #3086 from sr/c-api/add-trap-code-accessor
to main
.
srenatus submitted PR review.
srenatus created PR review comment:
I'm not a C expert either -- it felt to be a tad more consistent going with the enum definition. Updated :check_mark:️
srenatus updated PR #3086 from sr/c-api/add-trap-code-accessor
to main
.
srenatus has marked PR #3086 as ready for review.
alexcrichton submitted PR review.
alexcrichton merged PR #3086.
Last updated: Nov 22 2024 at 17:03 UTC