Skip to content

Commit 41b031f

Browse files
committed
Properly fix #2543
1 parent c0212c2 commit 41b031f

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

src/main/kotlin/platform/mixin/handlers/mixinextras/ModifyExpressionValueHandler.kt

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,10 +46,12 @@ class ModifyExpressionValueHandler : MixinExtrasInjectorAnnotationHandler() {
4646
return false
4747
}
4848

49-
// TODO: fix this to make it more accurate
50-
// val returnType = getInsnReturnType(insn) ?: return false
51-
// return returnType != Type.VOID_TYPE
52-
return true
49+
if (decorations[ExpressionDecorations.SIMPLE_EXPRESSION_TYPE] != null) {
50+
return true
51+
}
52+
53+
val returnType = getInsnReturnType(insn) ?: return false
54+
return returnType != Type.VOID_TYPE
5355
}
5456

5557
override val allowedInsnDescription = "instructions that return a value"

0 commit comments

Comments
 (0)