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.

--~--~---------~--~----~------------~-------~--~----~
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
-~----------~----~----~----~------~----~------~--~---

Reply via email to