Skip to content
Browse files

OnStack can mark a location on the stack that contains NULL

When we use OnStack, we might mark a location that holds the return
value of a call. This return value can be NULL to indicate an exception
so if we see a NULL here, that is a valid value and we just shouldn't do
anything with it.

Before this would cause a segmentation fault because we would deference
a NULL pointer.
  • Loading branch information...
1 parent 680dcb5 commit 0af7440855a326a3b9dc8dd8c1a8e41e88ab0d54 @dbussink dbussink committed Oct 1, 2012
Showing with 1 addition and 1 deletion.
  1. +1 −1 vm/gc/gc.cpp
2 vm/gc/gc.cpp
@@ -280,7 +280,7 @@ namespace rubinius {
Object** var = displace(buffer[idx], offset);
Object* tmp = *var;
- if(tmp->reference_p() && (!young_only || tmp->young_object_p())) {
+ if(tmp && tmp->reference_p() && (!young_only || tmp->young_object_p())) {
*var = saw_object(tmp);

0 comments on commit 0af7440

Please sign in to comment.
Something went wrong with that request. Please try again.