What steps will reproduce the problem?
1. Create a class with a function returning a reference
2. Convert that reference to a pointer with:
<modify-function signature="getFoo( )">
<modify-argument index="return">
<replace-type modified-type="Foo*" />
<conversion-rule class="native">
Foo* %out% = &%in%;
</conversion-rule>
</modify-argument>
</modify-function>
What is the expected output? What do you see instead?
This should result in a conversion in qtscript_Foo_prototype_call
that looks like
Foo& _q_result = _q_self->getFoo();
Foo* _q_convertedResult = &_q_result ;
return qScriptValueFromValue(context->engine(), _q_convertedResult);
but instead i get
Foo _q_result = _q_self->getFoo(); //reference type is missing
Foo* _q_convertedResult = &_q_result ; //creates a pointer to a local var
return qScriptValueFromValue(context->engine(), _q_convertedResult);
The pointer will get invalid when the function returns.
Original issue reported on code.google.com by zbnj...@gmail.com on 16 Feb 2010 at 3:25
Original issue reported on code.google.com by
zbnj...@gmail.com
on 16 Feb 2010 at 3:25