summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorAndreas Gampe <agampe@google.com>2015-08-14 14:07:43 -0700
committerAndreas Gampe <agampe@google.com>2015-08-14 14:33:39 -0700
commiteb9d1f79a79e3235f25889a25cdba465a7a0f7bf (patch)
tree1a25444c071b1105f1854acf4ec6751a89000caa /test
parente682a0250702c65a668e39eefdd1c49cfea5f388 (diff)
downloadart-eb9d1f79a79e3235f25889a25cdba465a7a0f7bf.zip
art-eb9d1f79a79e3235f25889a25cdba465a7a0f7bf.tar.gz
art-eb9d1f79a79e3235f25889a25cdba465a7a0f7bf.tar.bz2
ART: Relax verifier aput checking
When checking on a null array, the cases of aput and aput-wide are shared between integral and floating point types. Be careful to not reject a valid program. Bug: 21867457 Bug: 23201502 (cherry picked from commit 4bf4c78a6e8b7da7cf306e1dd17ff5a55d0c6c98) Change-Id: I6c54a389c06e40a2dae00995aa16ff08a089e512
Diffstat (limited to 'test')
-rw-r--r--test/800-smali/expected.txt2
-rw-r--r--test/800-smali/smali/b_23201502.smali23
-rw-r--r--test/800-smali/src/Main.java4
3 files changed, 29 insertions, 0 deletions
diff --git a/test/800-smali/expected.txt b/test/800-smali/expected.txt
index ebcaad1..49f5e6c 100644
--- a/test/800-smali/expected.txt
+++ b/test/800-smali/expected.txt
@@ -29,4 +29,6 @@ b/22331663 (pass)
b/22331663 (fail)
b/22881413
b/20843113
+b/23201502 (float)
+b/23201502 (double)
Done!
diff --git a/test/800-smali/smali/b_23201502.smali b/test/800-smali/smali/b_23201502.smali
new file mode 100644
index 0000000..d958938
--- /dev/null
+++ b/test/800-smali/smali/b_23201502.smali
@@ -0,0 +1,23 @@
+.class public LB23201502;
+
+.super Ljava/lang/Object;
+
+.method public static runFloat()V
+ .registers 3
+ const v0, 0 # Null array.
+ const v1, 0 # 0 index into array.
+ const v2, 0 # 0 value, will be turned into float.
+ int-to-float v2, v2 # Definitely make v2 float.
+ aput v2 , v0, v1 # Put into null array.
+ return-void
+.end method
+
+.method public static runDouble()V
+ .registers 4
+ const v0, 0 # Null array.
+ const v1, 0 # 0 index into array.
+ const v2, 0 # 0 value, will be turned into double.
+ int-to-double v2, v2 # Definitely make v2+v3 double.
+ aput-wide v2 , v0, v1 # Put into null array.
+ return-void
+.end method
diff --git a/test/800-smali/src/Main.java b/test/800-smali/src/Main.java
index e487374..1b954a7 100644
--- a/test/800-smali/src/Main.java
+++ b/test/800-smali/src/Main.java
@@ -103,6 +103,10 @@ public class Main {
new Object[] { false }, new VerifyError(), null));
testCases.add(new TestCase("b/22881413", "B22881413", "run", null, null, null));
testCases.add(new TestCase("b/20843113", "B20843113", "run", null, null, null));
+ testCases.add(new TestCase("b/23201502 (float)", "B23201502", "runFloat", null,
+ new NullPointerException(), null));
+ testCases.add(new TestCase("b/23201502 (double)", "B23201502", "runDouble", null,
+ new NullPointerException(), null));
}
public void runTests() {