v_this undeclared causing compilation failure #354

Closed
joelastpass opened this Issue Jun 16, 2011 · 2 comments

Comments

Projects
None yet
3 participants
Contributor

joelastpass commented Jun 16, 2011

This is a relatively new issue (used to compile without issue) the v_this variable is used but not defined anywhere.

/prod/lphiphop/cpp/050-0.cpp: In member function \xe2\x80\x98HPHP::Variant HPHP::c_SimplePie_Item::t_get_source()\xe2\x80\x99:\n/prod/lphiphop/cpp/050-0.cpp:12970: error: \xe2\x80\x98v_this\xe2\x80\x99 was not declared in this scope\n

/prod/lphiphop/cpp/050-0.cpp:12971: error: operands to ?: have different types \xe2\x80\x98const HPHP::SmartObjectHPHP::c_SimplePie_Item\xe2\x80\x99 and \xe2\x80\x98const HPHP::Variant\xe2\x80\x99\nmake[2]: *** [CMakeFiles/program.dir/cpp/050-0.cpp.o]

This is in simplepie/simplepie.inc line 5612 from the simplepie project: http://simplepie.org/

Code looks like:

Variant c_SimplePie_Item::t_get_source() {
INSTANCE_METHOD_INJECTION_ROOTLESS(SimplePie_Item, SimplePie_Item::get_source);
INTERCEPT_INJECTION("SimplePie_Item::get_source", null_array, r);
Variant v_return;

{
bool tmp0;
{
LINE(5614,0);
const Variant &tmp1((t_get_item_tags(NAMVAR(s_svsee7264d0, "http://www.w3.org/2005/Atom") /* SIMPLEPIE_NAMESPACE_ATOM_10 */, NAMVAR(s_svs9dd0babc, "source"))));
tmp0 = (toBoolean(v_return.assignVal(tmp1)));
}
if (tmp0) {
{
{
Object obj1(create_object_only((LINE(5616,(toString(m_feed.o_getPublic(NAMSTR(s_ss8a53c24e, "source_class"), true)))))));
MethodCallPackage mcp0;
mcp0.construct(obj1);
const CallInfo *cit0 = mcp0.ci;
const p_SimplePie_Item &tmp2((GET_THIS_TYPED(SimplePie_Item)));
const Variant tmp3 = v_this;
const Variant &tmp4 = cit0->isRef(0) ? tmp2 : tmp3;
const Variant &tmp5((v_return.argvalAt(cit0->isRef(1), 0LL)));
(cit0->getMeth2Args())(mcp0, 2, tmp4, tmp5);
return id(obj1);

I have this problem as well with latest hiphop checkout from git when attempting to compile PHPUnit, and it happens when I trim down PHPUnit to just these files from the source distribution:

PHPUnit/TestListener.php
PHPUnit/Framework/TestCase.php

The compiler error is:

/tmp/hphp_q3wdSn/php/home/david/peanut/PHPUnit/Framework/TestCase.cpp: In member function \xe2\x80\x98HPHP::Variant HPHP::c_PHPUnit_Framework_TestCase::t_run(HPHP::Variant)\xe2\x80\x99:
/tmp/hphp_q3wdSn/php/home/david/peanut/PHPUnit/Framework/TestCase.cpp:2442: error: \xe2\x80\x98v_this\xe2\x80\x99 was not declared in this scope
/tmp/hphp_q3wdSn/php/home/david/peanut/PHPUnit/Framework/TestCase.cpp:2443: error: operands to ?: have different types \xe2\x80\x98const HPHP::SmartObjectHPHP::c_PHPUnit_Framework_TestCase\xe2\x80\x99 and \xe2\x80\x98const HPHP::Variant\xe2\x80\x99
make[2]: *** [CMakeFiles/hpeanut.dir/php/home/david/peanut/PHPUnit/Framework/TestCase.cpp.o] Error 1
make[1]: *** [CMakeFiles/hpeanut.dir/all] Error 2
make: *** [all] Error 2

Which corresponds to this code:

                $result->addError(
                  $this,
                  new PHPUnit_Framework_SkippedTestError(
                    sprintf(
                      'This test depends on "%s" to pass.', $dependency
                    )
                  ),
                  0
                );

around line 527 of TestCase.php. $result is a PHPUnit_Framework_TestResult object.

Contributor

scottmac commented Jul 8, 2011

I think this was fixed now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment