Permalink
Browse files

Always initialize RData

Even though we normally initialize in Data further, we want to
initialize this anyway so in the case there are bugs they don't show
themselves as impossible to debug, but as a more normal segv because of
a null pointer dereference.
  • Loading branch information...
1 parent ef023b2 commit b08a25ee4e25ebf918c584fe2ea28230c859ffab @dbussink dbussink committed Jan 8, 2013
Showing with 3 additions and 3 deletions.
  1. +3 −3 vm/capi/data.cpp
View
6 vm/capi/data.cpp
@@ -15,9 +15,9 @@ namespace rubinius {
type_ = cRData;
RData* rdata = new RData;
- // Yes, we initialize it with garbage data. This is because when
- // Data creates this, it makes sure to initialize it before
- // anyone sees it.
+ rdata->data = 0;
+ rdata->dmark = 0;
+ rdata->dfree = 0;
as_.rdata = rdata;

0 comments on commit b08a25e

Please sign in to comment.