If you are calling the last function, with a default value for the second argument, you can make the second arg. explicit, and avoid a problem: Operand(0, RelocInfo::None)
On Fri, Jun 12, 2009 at 11:46 AM, Erik Corry <[email protected]> wrote: > > 2009/6/12 Benno <[email protected]>: > > > > In follow up to my earlier post "Compile Errors" (sorry for such a > > crap subject), I have some others. Specifically there is a lot of code > > that calls the Operand method like so: > > > > Operand(0) > > > > Which produces the following: > > > > src/arm/codegen-arm.cc:4432: error: call of overloaded 'Operand(int)' > > is ambiguous > > src/arm/assembler-arm-inl.h:180: note: candidates are: > > v8::internal::Operand::Operand(v8::internal::Smi*) > > src/arm/assembler-arm.h:313: note: > > v8::internal::Operand::Operand > > (v8::internal::Handle<v8::internal::Object>) > > src/arm/assembler-arm-inl.h:173: note: > > v8::internal::Operand::Operand(v8::internal::Context**) > > src/arm/assembler-arm-inl.h:166: note: > > v8::internal::Operand::Operand(v8::internal::Object**) > > src/arm/assembler-arm-inl.h:152: note: > > v8::internal::Operand::Operand(const char*) > > src/arm/assembler-arm-inl.h:145: note: > > v8::internal::Operand::Operand(int32_t, v8::internal::RelocInfo::Mode) > > > > I'm guessing this is because '0' is special in C++ and can refer to a > > NULL pointer (I think, I'm not a C++ guru by any means!). > > > > I was able to fix this by explicitly casting: > > > > Operand((int32_t)0) > > > > Is there any problem with this? Should I create a patch for this > > change? > > Thanks for pointing out this problem. The annoying thing is that the > same code is generated so it doesn't matter which one gets called. We > don't use C-style casts in V8 so you would have to use one of the C++ > casts. It quickly gets ugly. Are there a lot of call sites involved? > > > -- > Erik Corry, Software Engineer > Google Denmark ApS. CVR nr. 28 86 69 84 > c/o Philip & Partners, 7 Vognmagergade, P.O. Box 2227, DK-1018 > Copenhagen K, Denmark. > > > > -- William Hesse Software Engineer [email protected] Google Denmark ApS Frederiksborggade 20B, 1 sal 1360 København K Denmark CVR nr. 28 86 69 84 If you received this communication by mistake, please don't forward it to anyone else (it may contain confidential or privileged information), please erase all copies of it, including all attachments, and please let the sender know it went to the wrong person. Thanks. --~--~---------~--~----~------------~-------~--~----~ v8-dev mailing list [email protected] http://groups.google.com/group/v8-dev -~----------~----~----~----~------~----~------~--~---
