Skip to content

Commit

Permalink
fix test failure
Browse files Browse the repository at this point in the history
  • Loading branch information
kiszk committed Apr 8, 2017
1 parent 895a3be commit 3080ac2
Showing 1 changed file with 9 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -227,15 +227,20 @@ case class Invoke(
val funcResult = ctx.freshName("funcResult")
// If the function can return null, we do an extra check to make sure our null bit is still
// set correctly.
val postNullCheck = if (returnNullable) {
s"${ev.isNull} = ${ev.value} == null;"
val postNullCheck = if (!returnNullable) {
s"${ev.value} = (${ctx.boxedType(javaType)}) $funcResult;"
} else {
""
s"""
if ($funcResult != null) {
${ev.value} = (${ctx.boxedType(javaType)}) $funcResult;
} else {
${ev.isNull} = true;
}
"""
}
s"""
Object $funcResult = null;
${getFuncResult(funcResult, s"${obj.value}.$functionName($argString)")}
${ev.value} = (${ctx.boxedType(javaType)}) $funcResult;
$postNullCheck
"""
}
Expand Down

0 comments on commit 3080ac2

Please sign in to comment.