- fixed: String CVARs get stored as a const char *, not an FString, so the ls opcode cannot be used to read their content.

This commit is contained in:
Christoph Oelckers 2017-02-23 22:01:01 +01:00
parent c4cb94123f
commit 5bc26763cb
3 changed files with 13 additions and 1 deletions

View File

@ -6522,7 +6522,7 @@ ExpEmit FxCVar::Emit(VMFunctionBuilder *build)
case CVAR_String: case CVAR_String:
build->Emit(OP_LKP, addr.RegNum, build->GetConstantAddress(&static_cast<FStringCVar *>(CVar)->Value, ATAG_GENERIC)); build->Emit(OP_LKP, addr.RegNum, build->GetConstantAddress(&static_cast<FStringCVar *>(CVar)->Value, ATAG_GENERIC));
build->Emit(OP_LS, dest.RegNum, addr.RegNum, nul); build->Emit(OP_LCS, dest.RegNum, addr.RegNum, nul);
break; break;
case CVAR_DummyBool: case CVAR_DummyBool:

View File

@ -197,6 +197,16 @@ begin:
GETADDR(PB,RC,X_READ_NIL); GETADDR(PB,RC,X_READ_NIL);
reg.s[a] = *(FString *)ptr; reg.s[a] = *(FString *)ptr;
NEXTOP; NEXTOP;
OP(LCS):
ASSERTS(a); ASSERTA(B); ASSERTKD(C);
GETADDR(PB,KC,X_READ_NIL);
reg.s[a] = *(const char **)ptr;
NEXTOP;
OP(LCS_R):
ASSERTS(a); ASSERTA(B); ASSERTD(C);
GETADDR(PB,RC,X_READ_NIL);
reg.s[a] = *(const char **)ptr;
NEXTOP;
OP(LO): OP(LO):
ASSERTA(a); ASSERTA(B); ASSERTKD(C); ASSERTA(a); ASSERTA(B); ASSERTKD(C);
GETADDR(PB,KC,X_READ_NIL); GETADDR(PB,KC,X_READ_NIL);

View File

@ -52,6 +52,8 @@ xx(LV2, lv2, RVRPKI, LV2_R, 4, REGT_INT), // load vector2
xx(LV2_R, lv2, RVRPRI, NOP, 0, 0), xx(LV2_R, lv2, RVRPRI, NOP, 0, 0),
xx(LV3, lv3, RVRPKI, LV3_R, 4, REGT_INT), // load vector3 xx(LV3, lv3, RVRPKI, LV3_R, 4, REGT_INT), // load vector3
xx(LV3_R, lv3, RVRPRI, NOP, 0, 0), xx(LV3_R, lv3, RVRPRI, NOP, 0, 0),
xx(LCS, lcs, RSRPKI, LCS_R, 4, REGT_INT), // load string from char ptr.
xx(LCS_R, lcs, RSRPRI, NOP, 0, 0),
xx(LBIT, lbit, RIRPI8, NOP, 0, 0), // rA = !!(*rB & C) -- *rB is a byte xx(LBIT, lbit, RIRPI8, NOP, 0, 0), // rA = !!(*rB & C) -- *rB is a byte