Skip to content

Commit 7f70eb9

Browse files
authored
* Prevent Generator from swallowing exceptions caught on Buffer.array() (pull #504)
1 parent 2bf5449 commit 7f70eb9

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11

2+
* Prevent `Generator` from swallowing exceptions caught on `Buffer.array()` ([pull #504](https://github.com/bytedeco/javacpp/pull/504))
23
* Add `enum` classes missing from config files required by GraalVM Native Image
34
* Let `Parser` annotate `&&` parameters with new `@ByRef(true)` value used by `Generator` to call `std::move()`
45
* Fix `Parser` overlooking anonymous `class`, `struct` or `union` with comments after `}` ([issue #501](https://github.com/bytedeco/javacpp/issues/501))

src/main/java/org/bytedeco/javacpp/tools/Generator.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2237,7 +2237,7 @@ void parametersBefore(MethodInformation methodInfo) {
22372237
out.println(" arr" + j + " = (j" + paramNameLowerCase + "Array)env->CallObjectMethod(arg" + j + ", JavaCPP_arrayMID);");
22382238
out.println(" offset" + j + " = env->CallIntMethod(arg" + j + ", JavaCPP_arrayOffsetMID);");
22392239
out.println(" if (env->ExceptionOccurred() != NULL) {");
2240-
out.println(" env->ExceptionClear();");
2240+
out.println(" return" + (methodInfo.returnType == void.class ? ";" : " 0;"));
22412241
out.println(" } else {");
22422242
if (methodInfo.criticalRegion) {
22432243
out.println(" ptr" + j + " = arr" + j + " == NULL ? NULL : (" + typeName[0] + typeName[1]

0 commit comments

Comments
 (0)