Merge "Fix OOM test case to handle more optimizations"
diff --git a/test/080-oom-throw/src/Main.java b/test/080-oom-throw/src/Main.java
index 035690f..c93f8bb 100644
--- a/test/080-oom-throw/src/Main.java
+++ b/test/080-oom-throw/src/Main.java
@@ -31,6 +31,7 @@
 
     static class InstanceMemEater {
         static boolean sawOome;
+        static InstanceMemEater hook;
 
         InstanceMemEater next;
         double d1, d2, d3, d4, d5, d6, d7, d8; // Bloat this object so we fill the heap faster.
@@ -45,6 +46,7 @@
         }
 
         static void confuseCompilerOptimization(InstanceMemEater instance) {
+          hook = instance;
         }
     }
 
@@ -61,6 +63,7 @@
             lastMemEater = lastMemEater.next;
         } while (lastMemEater != null);
         memEater.confuseCompilerOptimization(memEater);
+        InstanceMemEater.hook = null;
         return InstanceMemEater.sawOome;
     }