Convert a few tvFoo functions to take parameters by reference
Since TypedValue::operator= is dangerous, something like tvTeleport is usually what you want to use, but it doesn't work with temporary TypedValues (e.g. return values of things like make_tv or cellAdd), because it took the arguments by pointer. This also means we can change it to take parameters by value later without updating callsites. This diff does the tvDup family and changes tvTeleport to tvCopy. I'll gradually get the other ones done, but I just need these for now to work with temporaries for changing SetOp to not use Variant arithmetic.
Esse commit está contido em:
@@ -838,7 +838,7 @@ void HphpArray::compact(bool renumber /* = false */) {
|
||||
}
|
||||
|
||||
static inline void elemConstruct(const TypedValue* fr, TypedValue* to) {
|
||||
tvDupCell(tvToCell(fr), to);
|
||||
cellDup(*tvToCell(fr), *to);
|
||||
}
|
||||
|
||||
bool HphpArray::nextInsert(CVarRef data) {
|
||||
|
||||
Referência em uma Nova Issue
Bloquear um usuário