8161907: adlc: Fix crash in cisc_spill_match if _rChild == NULL
authorgoetz
Wed, 20 Jul 2016 12:34:11 +0200
changeset 40088 02cc68c622b2
parent 40087 33cbd46c3241
child 40089 1806aff6f2d1
child 40090 fd448de45578
8161907: adlc: Fix crash in cisc_spill_match if _rChild == NULL Reviewed-by: kvn
hotspot/src/share/vm/adlc/formssel.cpp
--- a/hotspot/src/share/vm/adlc/formssel.cpp	Mon Jul 25 14:31:42 2016 -0700
+++ b/hotspot/src/share/vm/adlc/formssel.cpp	Wed Jul 20 12:34:11 2016 +0200
@@ -3647,14 +3647,14 @@
     // Check left operands
     if( (_lChild == NULL) && (mRule2->_lChild == NULL) ) {
       left_spillable = Maybe_cisc_spillable;
-    } else {
+    } else  if (_lChild != NULL) {
       left_spillable = _lChild->cisc_spill_match(globals, registers, mRule2->_lChild, operand, reg_type);
     }
 
     // Check right operands
     if( (_rChild == NULL) && (mRule2->_rChild == NULL) ) {
       right_spillable =  Maybe_cisc_spillable;
-    } else {
+    } else if (_rChild != NULL) {
       right_spillable = _rChild->cisc_spill_match(globals, registers, mRule2->_rChild, operand, reg_type);
     }