for cat() replacements, confine frame knowledge to aux

This commit is contained in:
Vern Paxson 2024-06-03 16:02:35 -07:00
parent b62b31846e
commit 8088f91145
5 changed files with 104 additions and 90 deletions

View file

@ -337,6 +337,21 @@ public:
return zv;
}
// The same, but for read-only access for which memory-management is
// not required.
const ZVal& ToDirectZVal(const ZVal* frame) const {
if ( c )
return zc;
if ( i >= 0 )
return frame[i];
// Currently the way we use AuxElem's we shouldn't get here, but
// just in case we do, return something sound rather than mis-indexing
// the frame.
static ZVal null_zval;
return null_zval;
}
int Slot() const { return i; }
int IntVal() const { return i; }
const ValPtr& Constant() const { return c; }