-
Notifications
You must be signed in to change notification settings - Fork 314
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
java: allocate execute result in C #558
Conversation
@@ -95,11 +108,14 @@ JNIEXPORT void JNICALL Java_org_ethereum_evmc_EvmcVm_execute(JNIEnv* jenv, | |||
struct evmc_vm* evm = (struct evmc_vm*)(*jenv)->GetDirectBufferAddress(jenv, jevm); | |||
assert(evm != NULL); | |||
const struct evmc_host_interface* host = evmc_java_get_host_interface(); | |||
jobject jresult = allocateDirect(jenv, sizeof(struct evmc_result)); | |||
assert(jresult != NULL); | |||
struct evmc_result* result = | |||
(struct evmc_result*)(*jenv)->GetDirectBufferAddress(jenv, jresult); | |||
assert(result != NULL); | |||
*result = evmc_execute(evm, host, (struct evmc_host_context*)jcontext, (enum evmc_revision)jrev, |
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.
This is still broken because it just copies the evmc_result struct, but the pointers to output are left loose. We need to move to a proper Java Result
class, i.e. #555.
However, the PR does not change semantics.
f2db15a
to
bab5076
Compare
bab5076
to
1342988
Compare
It's been a while. Happy to approve this PR as it seems relatively small, but I have a hard time recalling all the context. If it helps land #555 that's great. |
1342988
to
ee5bad7
Compare
Codecov Report
@@ Coverage Diff @@
## master #558 +/- ##
=======================================
Coverage 93.78% 93.78%
=======================================
Files 25 25
Lines 3746 3746
=======================================
Hits 3513 3513
Misses 233 233 |
This could be replaced with just passing buffers allocated based on #555.
Part of #548.