Skip to content

Commit 4a8dbc5

Browse files
committed
Various fixes
1 parent 8aebfd0 commit 4a8dbc5

File tree

5 files changed

+6
-5
lines changed

5 files changed

+6
-5
lines changed

src/jvm_wrapper/kotlin_callable_custom.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@ bool LambdaContainer::equals(const LambdaContainer& other) const {
3131

3232
LambdaContainer::LambdaContainer(jni::Env& p_env, jni::JObject p_wrapped, Variant::Type return_type, int p_hash_code, bool p_has_on_cancel) :
3333
JvmInstanceWrapper(p_env, p_wrapped),
34-
has_return_value {return_type != Variant::NIL},
3534
hash_code {p_hash_code},
35+
has_return_value {return_type != Variant::NIL},
3636
has_on_cancel {p_has_on_cancel},
3737
has_been_called {false} {}
3838

src/jvm_wrapper/memory/transfer_context.cpp

+2-3
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,6 @@ void TransferContext::icall(JNIEnv* rawEnv, jobject instance, jlong j_ptr, jlong
8787

8888
Callable::CallError r_error {Callable::CallError::CALL_OK};
8989

90-
Variant ret_value;
9190
if (unlikely(stack_offset + args_size > MAX_STACK_SIZE)) {
9291
Variant args[MAX_FUNCTION_ARG_COUNT];
9392
read_args_to_array(buffer, args, args_size);
@@ -97,7 +96,7 @@ void TransferContext::icall(JNIEnv* rawEnv, jobject instance, jlong j_ptr, jlong
9796
args_ptr[i] = &args[i];
9897
}
9998

100-
method_bind->validated_call(ptr, args_ptr, &ret_value);
99+
const Variant& ret_value {method_bind->call(ptr, args_ptr, args_size, r_error)};
101100
buffer->rewind();
102101

103102
VariantToBuffer::write_variant(ret_value, buffer);
@@ -108,7 +107,7 @@ void TransferContext::icall(JNIEnv* rawEnv, jobject instance, jlong j_ptr, jlong
108107
const Variant** args_ptr {variant_args_ptr + stack_offset};
109108

110109
stack_offset += args_size;
111-
method_bind->validated_call(ptr, args_ptr, &ret_value);
110+
const Variant& ret_value {method_bind->call(ptr, args_ptr, args_size, r_error)};
112111
// Remove Variants so memory can be freed immediately after method call.
113112
for (uint32_t i = 0; i < args_size; i++) {
114113
args[i] = Variant();

src/jvm_wrapper/registration/kt_class.cpp

-1
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,6 @@ void KtClass::fetch_methods(jni::Env& env) {
100100
for (int i = 0; i < functionsArray.length(env); i++) {
101101
jni::JObject object = functionsArray.get(env, i);
102102
auto* ktFunction {new KtFunction(env, object)};
103-
auto test = methods[ktFunction->get_name()];
104103
methods[ktFunction->get_name()] = ktFunction;
105104
JVM_DEV_VERBOSE("Fetched method %s for class %s", ktFunction->get_name(), registered_class_name);
106105
}

src/lifecycle/jvm_manager.cpp

+1
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ CreateJavaVM get_create_jvm_function(void* lib_handle) {
4343
#else
4444
// Sanity check in case we mess up preprocessors
4545
JVM_DEV_ASSERT(false, "Current configuration doesn't provide a way to create a JVM!");
46+
return nullptr;
4647
#endif
4748
}
4849

src/lifecycle/jvm_user_configuration.cpp

+2
Original file line numberDiff line numberDiff line change
@@ -278,9 +278,11 @@ void JvmUserConfiguration::parse_command_line(const List<String>& args, HashMap<
278278
configuration_map[JVM_ARGUMENTS_CMD_IDENTIFIER] = arr;
279279
}
280280

281+
#ifdef DEV_ENABLED
281282
for (const auto& map_element : configuration_map) {
282283
JVM_DEV_VERBOSE("Value for commandline argument: %s -> %s", map_element.key, map_element.value);
283284
}
285+
#endif
284286
}
285287
}
286288

0 commit comments

Comments
 (0)