Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Index: dispatcher.cpp
- ===================================================================
- --- dispatcher.cpp (revision 3033)
- +++ dispatcher.cpp (working copy)
- @@ -1604,19 +1604,22 @@
- std::map<void *, rb_vm_block_t *>::iterator iter = blocks.find(key);
- rb_vm_block_t *b;
- + int alloc_mask = VM_BLOCK_ACTIVE | VM_BLOCK_PROC | VM_BLOCK_IFUNC;
- - if ((iter == blocks.end())
- - || (iter->second->flags & (VM_BLOCK_ACTIVE | VM_BLOCK_PROC))) {
- + if ((iter == blocks.end()) || (iter->second->flags & alloc_mask)) {
- + bool is_ifunc = (iter != blocks.end())
- + && ((iter->second->flags & VM_BLOCK_IFUNC) == VM_BLOCK_IFUNC);
- - if (iter != blocks.end()) {
- + if (is_ifunc == false && iter != blocks.end()) {
- rb_objc_release(iter->second);
- }
- -
- b = (rb_vm_block_t *)xmalloc(sizeof(rb_vm_block_t)
- + (sizeof(VALUE *) * dvars_size));
- - rb_objc_retain(b);
- + if (is_ifunc == false) {
- + rb_objc_retain(b);
- + blocks[key] = b;
- + }
- - blocks[key] = b;
- *cached = false;
- }
- else {
Add Comment
Please, Sign In to add comment