diff --git a/src/compile.cpp b/src/compile.cpp index 86432bb131..4c5df946d3 100644 --- a/src/compile.cpp +++ b/src/compile.cpp @@ -879,7 +879,7 @@ class TraceElement: public TraceHandler { flags(flags), watch(false) { - memset(map, 0, mapSize * BytesPerWord); + memset(map, 0xFF, mapSize * BytesPerWord); } virtual void handleTrace(Promise* address, unsigned argumentIndex) { diff --git a/test/Subroutine.java b/test/Subroutine.java index b02ec9ba81..d566f78095 100644 --- a/test/Subroutine.java +++ b/test/Subroutine.java @@ -15,6 +15,23 @@ public class Subroutine { if (! v) throw new RuntimeException(); } + private static void stackMap(Object x) { + while (true) { + try { + try { + System.gc(); + } catch (DummyException e) { + // ignore + } finally { + x.toString(); + } + break; + } catch (DummyException e) { + // ignore + } + } + } + private static byte[] makeTestCode(List pool) throws IOException { ByteArrayOutputStream out = new ByteArrayOutputStream(); Stream.write2(out, 1); // max stack @@ -292,6 +309,8 @@ public class Subroutine { makeTestClass().getMethod("test", new Class[0]).invoke (null, new Object[0]); + + stackMap(new Object()); } private static class DummyException extends RuntimeException { }