mirror of
https://github.com/ZDoom/qzdoom.git
synced 2024-11-13 07:57:58 +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)
|
if (func == nullptr)
|
||||||
{
|
{
|
||||||
VMFunctionBuilder buildit;
|
VMFunctionBuilder buildit(true);
|
||||||
|
|
||||||
assert(tcall->Proto != nullptr);
|
assert(tcall->Proto != nullptr);
|
||||||
|
|
||||||
|
|
|
@ -3373,7 +3373,7 @@ FxExpression *FxClassMember::Resolve(FCompileContext &ctx)
|
||||||
|
|
||||||
ExpEmit FxClassMember::Emit(VMFunctionBuilder *build)
|
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.
|
{ // Check if this is a user-defined variable.
|
||||||
// As of right now, FxClassMember is only ever used with FxSelf.
|
// As of right now, FxClassMember is only ever used with FxSelf.
|
||||||
// This very user variable was defined in stateowner so if
|
// This very user variable was defined in stateowner so if
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
//
|
//
|
||||||
//==========================================================================
|
//==========================================================================
|
||||||
|
|
||||||
VMFunctionBuilder::VMFunctionBuilder()
|
VMFunctionBuilder::VMFunctionBuilder(bool selfcheck)
|
||||||
{
|
{
|
||||||
NumIntConstants = 0;
|
NumIntConstants = 0;
|
||||||
NumFloatConstants = 0;
|
NumFloatConstants = 0;
|
||||||
|
@ -14,6 +14,7 @@ VMFunctionBuilder::VMFunctionBuilder()
|
||||||
NumStringConstants = 0;
|
NumStringConstants = 0;
|
||||||
MaxParam = 0;
|
MaxParam = 0;
|
||||||
ActiveParam = 0;
|
ActiveParam = 0;
|
||||||
|
IsActionFunc = selfcheck;
|
||||||
}
|
}
|
||||||
|
|
||||||
//==========================================================================
|
//==========================================================================
|
||||||
|
|
|
@ -23,7 +23,7 @@ public:
|
||||||
friend class VMFunctionBuilder;
|
friend class VMFunctionBuilder;
|
||||||
};
|
};
|
||||||
|
|
||||||
VMFunctionBuilder();
|
VMFunctionBuilder(bool checkself = false);
|
||||||
~VMFunctionBuilder();
|
~VMFunctionBuilder();
|
||||||
|
|
||||||
VMScriptFunction *MakeFunction();
|
VMScriptFunction *MakeFunction();
|
||||||
|
@ -60,6 +60,9 @@ public:
|
||||||
// Track available registers.
|
// Track available registers.
|
||||||
RegAvailability Registers[4];
|
RegAvailability Registers[4];
|
||||||
|
|
||||||
|
// For use by DECORATE's self/stateowner sanitizer.
|
||||||
|
bool IsActionFunc;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
struct AddrKonst
|
struct AddrKonst
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue