-
Notifications
You must be signed in to change notification settings - Fork 315
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
Rust: add support for create_vm and execute #223
Conversation
Some notes:
|
bindings/rust/evmc-vm/src/lib.rs
Outdated
static [<$__vm _VERSION>]: &'static str = $__version; | ||
} | ||
|
||
paste::item! { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should have here a large comment explaining this will lay out memory in a format acceptable to C (repr(C)
) and that's why we can include both data structures here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
will do
macro_rules! evmc_create_vm { | ||
($__vm:ident, $__version:expr) => { | ||
paste::item! { | ||
static [<$__vm _NAME>]: &'static str = stringify!($__vm); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please separate the VM name and the name of the VM struct.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I mean the VM name may contain space and this will fail in that case.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
discussed offline. figuring this out later
5aacc08
to
2176ca3
Compare
bindings/rust/evmc-vm/src/lib.rs
Outdated
}; | ||
|
||
let instance = unsafe { [<$__vm Instance>]::coerce_from_raw(instance) }; | ||
let result: ExecutionResult = instance.get_vm().execute(code_ref, &host); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should wrap this in std::catch_panic
.
2b54242
to
a18ba10
Compare
This is passing vmtester now with the macro monstrosity. At least locally. |
b4dd1a4
to
db0acbf
Compare
Superseded by #262. |
Part of #168.