changeset 9139:17045c93c903

[c1] [Spec98] _228_jack crash Contributed-by: akozlov@azul.com
author snazarki
date Wed, 10 Jul 2019 19:05:51 +0300
parents d684b965077b
children 6f05add32df5
files src/cpu/aarch32/vm/vtableStubs_aarch32.cpp
diffstat 1 files changed, 10 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/cpu/aarch32/vm/vtableStubs_aarch32.cpp	Wed Jul 10 19:03:16 2019 +0300
+++ b/src/cpu/aarch32/vm/vtableStubs_aarch32.cpp	Wed Jul 10 19:05:51 2019 +0300
@@ -53,6 +53,11 @@
 VtableStub* VtableStubs::create_vtable_stub(int vtable_index) {
   const int aarch32_code_length = VtableStub::pd_code_size_limit(true);
   VtableStub* s = new(aarch32_code_length) VtableStub(true, vtable_index);
+  // Can be NULL if there is no free space in the code cache.
+  if (s == NULL) {
+    return NULL;
+  }
+
   ResourceMark rm;
   CodeBuffer cb(s->entry_point(), aarch32_code_length);
   MacroAssembler* masm = new MacroAssembler(&cb);
@@ -125,6 +130,11 @@
   // returned by pd_code_size_limit!
   const int code_length = VtableStub::pd_code_size_limit(false);
   VtableStub* s = new(code_length) VtableStub(false, itable_index);
+  // Can be NULL if there is no free space in the code cache.
+  if (s == NULL) {
+    return NULL;
+  }
+
   ResourceMark rm;
   CodeBuffer cb(s->entry_point(), code_length);
   MacroAssembler* masm = new MacroAssembler(&cb);