Skip to content

Commit 9581c69

Browse files
committed
fix SEGV by *correctly* getting the address of the data member
1 parent 211f33b commit 9581c69

File tree

1 file changed

+2
-11
lines changed

1 file changed

+2
-11
lines changed

vm/builtin/io.cpp

+2-11
Original file line numberDiff line numberDiff line change
@@ -1560,20 +1560,11 @@ namespace rubinius {
15601560
return cFalse;
15611561
}
15621562
}
1563-
1564-
#define READ(type, ptr) (*((type*)(ptr)))
15651563

15661564
Object* FDSet::to_set(STATE) {
1567-
Object* ret;
1568-
1569-
void *lptr = READ(void*, descriptor_set);
1570-
if(!lptr) {
1571-
ret = cNil;
1572-
} else {
1573-
ret = Pointer::create(state, lptr);
1574-
}
1565+
void *ptr = (void*)&descriptor_set;
15751566

1576-
return ret;
1567+
return Pointer::create(state, ptr);
15771568
}
15781569

15791570
}; // ends namespace rubinius

0 commit comments

Comments
 (0)