[MacRuby] #1326: Cannot create nested modules with names used by Cocoa classes when using the C API
#1326: Cannot create nested modules with names used by Cocoa classes when using the C API ------------------------------------+--------------------------------------- Reporter: mrada@… | Owner: lsansonetti@… Type: defect | Status: new Priority: minor | Milestone: Component: MacRuby | Keywords: ------------------------------------+--------------------------------------- Referring to: https://gist.github.com/66da73fa9f138ff49882 If you use rb_define_module_under() to create a new module in a different module, it will fail if the new modules name is the same as a Cocoa class (e.g. "NSString"): {{{ mTest = rb_define_module("Test"); rb_define_module_under(mTest, "NSString"); // TypeError: Test::NSString:Class is not a module }}} The weird part is that this will not fail if you wrote the code in pure Ruby: {{{ module Test module NSString end end }}} This is an inconsistency. -- Ticket URL: <http://www.macruby.org/trac/ticket/1326> MacRuby <http://macruby.org/>
#1326: Cannot create nested modules with names used by Cocoa classes when using the C API ------------------------------------+--------------------------------------- Reporter: mrada@… | Owner: lsansonetti@… Type: defect | Status: new Priority: minor | Milestone: Component: MacRuby | Keywords: ------------------------------------+--------------------------------------- Comment(by mrada@…): This is caused by how constants are looked up. In variable.c both rb_const_defined_0 and rb_const_get_0 check for Cocoa classes even if the lookup should not be recursive. I think it is an easy fix that I can do tonight... -- Ticket URL: <http://www.macruby.org/trac/ticket/1326#comment:1> MacRuby <http://macruby.org/>
#1326: Cannot create nested modules with names used by Cocoa classes when using the C API ------------------------------------+--------------------------------------- Reporter: mrada@… | Owner: lsansonetti@… Type: defect | Status: new Priority: minor | Milestone: Component: MacRuby | Keywords: ------------------------------------+--------------------------------------- Comment(by mrada@…): I made my fix and pushed to github: https://github.com/ferrous26/MacRuby/commit/33ccff6a9d86f616b30df6cbef9b7955... However, it is causing one of the specs to crash the entire test suite: {{{ 0 libunwind.dylib 0x00007fff899e5960 libunwind::LocalAddressSpace::getEncodedP(unsigned long long&, unsigned long long, unsigned char) + 234 1 libunwind.dylib 0x00007fff899e74e3 libunwind::CFI_Parser<libunwind::LocalAddressSpace>::decodeFDE(libunwind::LocalAddressSpace&, unsigned long long, libunwind::CFI_Parser<libunwind::LocalAddressSpace>::FDE_Info*, libunwind::CFI_Parser<libunwind::LocalAddressSpace>::CIE_Info*) + 335 2 libunwind.dylib 0x00007fff899e5b07 _unw_add_dynamic_fde + 31 3 libmacruby.dylib 0x000000010ed37dfb llvm::ExecutionEngine::RegisterTable(llvm::Function const*, void*) + 47 4 libmacruby.dylib 0x000000010ed360a3 (anonymous namespace)::JITEmitter::finishFunction(llvm::MachineFunction&) + 3413 5 libmacruby.dylib 0x000000010eb64317 (anonymous namespace)::Emitter<llvm::JITCodeEmitter>::runOnMachineFunction(llvm::MachineFunction&) + 379 6 libmacruby.dylib 0x000000010ed961f5 llvm::MachineFunctionPass::runOnFunction(llvm::Function&) + 117 7 libmacruby.dylib 0x000000010f05c898 llvm::FPPassManager::runOnFunction(llvm::Function&) + 306 8 libmacruby.dylib 0x000000010f05d9ba llvm::FunctionPassManagerImpl::run(llvm::Function&) + 212 9 libmacruby.dylib 0x000000010f05dad5 llvm::FunctionPassManager::run(llvm::Function&) + 79 10 libmacruby.dylib 0x000000010ed29c0f llvm::JIT::getPointerToFunction(llvm::Function*) + 599 11 libmacruby.dylib 0x000000010eae6361 RoxorCore::compile(llvm::Function*, bool) + 145 (vm.cpp:595) 12 libmacruby.dylib 0x000000010eaddb7b rb_vm_prepare_block + 1467 (dispatcher.cpp:1392) 13 ??? 0x0000000114575d1b 0 + 4636237083 }}} I guess something is going wrong when an exception is being raised? I'll try and track down the specific spec later... -- Ticket URL: <http://www.macruby.org/trac/ticket/1326#comment:2> MacRuby <http://macruby.org/>
participants (1)
-
MacRuby