Set invoke-method position for inlined synchronized monitor-enter
Bug: 172859303
Change-Id: I591cc18459609b0aea330be7db432c56905ab41c
diff --git a/src/main/java/com/android/tools/r8/ir/optimize/Inliner.java b/src/main/java/com/android/tools/r8/ir/optimize/Inliner.java
index 945d9fe..3abbf9b 100644
--- a/src/main/java/com/android/tools/r8/ir/optimize/Inliner.java
+++ b/src/main/java/com/android/tools/r8/ir/optimize/Inliner.java
@@ -707,7 +707,10 @@
assert !monitorEnterBlock.hasCatchHandlers();
InstructionListIterator monitorEnterBlockIterator = monitorEnterBlock.listIterator(code);
- monitorEnterBlockIterator.setInsertionPosition(Position.syntheticNone());
+ // MonitorEnter will only throw an NPE if the lock is null and that can only happen if the
+ // receiver was null. To preserve NPE's at call-sites for synchronized methods we therefore
+ // put in the invoke-position.
+ monitorEnterBlockIterator.setInsertionPosition(invoke.getPosition());
// If this is a static method, then the class object will act as the lock, so we load it
// using a const-class instruction.
diff --git a/tools/run_on_app_dump.py b/tools/run_on_app_dump.py
index d3a00bd..03687af 100755
--- a/tools/run_on_app_dump.py
+++ b/tools/run_on_app_dump.py
@@ -319,8 +319,6 @@
'url': 'https://github.com/chrisbanes/tivi',
'revision': '8e2ddd8fe2d343264a66aa1ef8acbd4cc587e8ce',
'folder': 'tivi',
- # TODO(b/172859303): Fix recompilation
- 'skip_recompilation': True
}),
App({
'id': 'com.keylesspalace.tusky',
@@ -330,8 +328,6 @@
'url': 'https://github.com/tuskyapp/Tusky',
'revision': '814a9b8f9bacf8d26f712b06a0313a3534a2be95',
'folder': 'tusky',
- # TODO(b/172859303): This fails with same error as tivi
- 'skip_recompilation': True
}),
App({
'id': 'org.wikipedia',