diff --git a/src/scripting/vm/vm.h b/src/scripting/vm/vm.h index 3874df2a7..6c66c7b85 100644 --- a/src/scripting/vm/vm.h +++ b/src/scripting/vm/vm.h @@ -707,7 +707,6 @@ class VMFunction public: bool Unsafe = false; int VarFlags = 0; // [ZZ] this replaces 5+ bool fields - int BarrierSide = 0; // [ZZ] FScopeBarrier::Side BYTE ImplicitArgs = 0; // either 0 for static, 1 for method or 3 for action unsigned VirtualIndex = ~0u; FName Name; @@ -940,7 +939,7 @@ class VMNativeFunction : public VMFunction public: typedef int (*NativeCallType)(VMValue *param, TArray &defaultparam, int numparam, VMReturn *ret, int numret); - // 8 is VARF_Native. + // 8 is VARF_Native. I can't write VARF_Native because of circular references between this and dobject/dobjtype. VMNativeFunction() : NativeCall(NULL) { VarFlags = 8; } VMNativeFunction(NativeCallType call) : NativeCall(call) { VarFlags = 8; } VMNativeFunction(NativeCallType call, FName name) : VMFunction(name), NativeCall(call) { VarFlags = 8; } diff --git a/src/scripting/zscript/zcc_compile.cpp b/src/scripting/zscript/zcc_compile.cpp index 533104121..49485da4e 100644 --- a/src/scripting/zscript/zcc_compile.cpp +++ b/src/scripting/zscript/zcc_compile.cpp @@ -2415,7 +2415,6 @@ void ZCCCompiler::CompileFunction(ZCC_StructWork *c, ZCC_FuncDeclarator *f, bool if (sym->Variants[0].Implementation != nullptr) { // [ZZ] unspecified virtual function inherits old scope. virtual function scope can't be changed. - sym->Variants[0].Implementation->BarrierSide = FScopeBarrier::SideFromFlags(varflags); sym->Variants[0].Implementation->VarFlags = sym->Variants[0].Flags; } @@ -2461,8 +2460,7 @@ void ZCCCompiler::CompileFunction(ZCC_StructWork *c, ZCC_FuncDeclarator *f, bool Error(f, "Attempt to change private/protected qualifiers for virtual function %s", FName(f->Name).GetChars()); } // inherit scope of original function if override not specified - sym->Variants[0].Implementation->BarrierSide = oldfunc->BarrierSide; - sym->Variants[0].Flags = FScopeBarrier::ChangeSideInFlags(sym->Variants[0].Flags, oldfunc->BarrierSide); + sym->Variants[0].Flags = FScopeBarrier::ChangeSideInFlags(sym->Variants[0].Flags, FScopeBarrier::SideFromFlags(oldfunc->VarFlags)); // inherit const from original function if (oldfunc->VarFlags & VARF_ReadOnly) sym->Variants[0].Flags |= VARF_ReadOnly;