mirror of
https://github.com/ZDoom/qzdoom.git
synced 2024-11-11 07:11:54 +00:00
Only generate the self==stateowner check inside action functions
This commit is contained in:
parent
51ffd6d9c6
commit
944ae2bc09
4 changed files with 8 additions and 4 deletions
|
@ -288,7 +288,7 @@ static void FinishThingdef()
|
|||
|
||||
if (func == nullptr)
|
||||
{
|
||||
VMFunctionBuilder buildit;
|
||||
VMFunctionBuilder buildit(true);
|
||||
|
||||
assert(tcall->Proto != nullptr);
|
||||
|
||||
|
|
|
@ -3373,7 +3373,7 @@ FxExpression *FxClassMember::Resolve(FCompileContext &ctx)
|
|||
|
||||
ExpEmit FxClassMember::Emit(VMFunctionBuilder *build)
|
||||
{
|
||||
if (~membervar->Flags & VARF_Native)
|
||||
if (build->IsActionFunc && ~membervar->Flags & VARF_Native)
|
||||
{ // Check if this is a user-defined variable.
|
||||
// As of right now, FxClassMember is only ever used with FxSelf.
|
||||
// This very user variable was defined in stateowner so if
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
//
|
||||
//==========================================================================
|
||||
|
||||
VMFunctionBuilder::VMFunctionBuilder()
|
||||
VMFunctionBuilder::VMFunctionBuilder(bool selfcheck)
|
||||
{
|
||||
NumIntConstants = 0;
|
||||
NumFloatConstants = 0;
|
||||
|
@ -14,6 +14,7 @@ VMFunctionBuilder::VMFunctionBuilder()
|
|||
NumStringConstants = 0;
|
||||
MaxParam = 0;
|
||||
ActiveParam = 0;
|
||||
IsActionFunc = selfcheck;
|
||||
}
|
||||
|
||||
//==========================================================================
|
||||
|
|
|
@ -23,7 +23,7 @@ public:
|
|||
friend class VMFunctionBuilder;
|
||||
};
|
||||
|
||||
VMFunctionBuilder();
|
||||
VMFunctionBuilder(bool checkself = false);
|
||||
~VMFunctionBuilder();
|
||||
|
||||
VMScriptFunction *MakeFunction();
|
||||
|
@ -60,6 +60,9 @@ public:
|
|||
// Track available registers.
|
||||
RegAvailability Registers[4];
|
||||
|
||||
// For use by DECORATE's self/stateowner sanitizer.
|
||||
bool IsActionFunc;
|
||||
|
||||
private:
|
||||
struct AddrKonst
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue