3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-04-05 17:14:07 +00:00

Handle _out(STRING) parameters in Java API (#6325)

This commit is contained in:
Thomas Pani 2022-09-07 00:29:12 +02:00 committed by GitHub
parent 9732169b04
commit adf6e98cdf
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -776,6 +776,13 @@ def mk_java(java_src, java_dir, package_name):
java_wrapper.write(' jfieldID fid = jenv->GetFieldID(mc, "value", "I");\n')
java_wrapper.write(' jenv->SetIntField(a%s, fid, (jint) _a%s);\n' % (i, i))
java_wrapper.write(' }\n')
elif param_type(param) == STRING:
java_wrapper.write(' {\n')
java_wrapper.write(' jclass mc = jenv->GetObjectClass(a%s);\n' % i)
java_wrapper.write(' jfieldID fid = jenv->GetFieldID(mc, "value", "Ljava/lang/String;");')
java_wrapper.write(' jstring fval = jenv->NewStringUTF(_a%s);\n' % i)
java_wrapper.write(' jenv->SetObjectField(a%s, fid, fval);\n' % i)
java_wrapper.write(' }\n')
else:
java_wrapper.write(' {\n')
java_wrapper.write(' jclass mc = jenv->GetObjectClass(a%s);\n' % i)