Skip to content

Commit

Permalink
fix SEGV by *correctly* getting the address of the data member
Browse files Browse the repository at this point in the history
  • Loading branch information
chuckremes committed Oct 1, 2015
1 parent 211f33b commit 9581c69
Showing 1 changed file with 2 additions and 11 deletions.
13 changes: 2 additions & 11 deletions vm/builtin/io.cpp
Expand Up @@ -1560,20 +1560,11 @@ namespace rubinius {
return cFalse;
}
}

#define READ(type, ptr) (*((type*)(ptr)))

Object* FDSet::to_set(STATE) {
Object* ret;

void *lptr = READ(void*, descriptor_set);
if(!lptr) {
ret = cNil;
} else {
ret = Pointer::create(state, lptr);
}
void *ptr = (void*)&descriptor_set;

return ret;
return Pointer::create(state, ptr);
}

}; // ends namespace rubinius
Expand Down

0 comments on commit 9581c69

Please sign in to comment.