mirror of
https://github.com/ZDoom/gzdoom-gles.git
synced 2024-11-16 17:41:19 +00:00
- Readonly pointer casting now works in ZScript.
This commit is contained in:
parent
af3635dfd9
commit
3bd16afc0f
1 changed files with 1 additions and 8 deletions
|
@ -4699,14 +4699,7 @@ FxExpression *FxDynamicCast::Resolve(FCompileContext& ctx)
|
|||
{
|
||||
CHECKRESOLVED();
|
||||
SAFE_RESOLVE(expr, ctx);
|
||||
bool constflag = expr->ValueType->isPointer() && expr->ValueType->toPointer()->IsConst;
|
||||
if (constflag)
|
||||
{
|
||||
// readonly pointers are normally only used for class defaults which lack type information to be cast properly, so we have to error out here.
|
||||
ScriptPosition.Message(MSG_ERROR, "Cannot cast a readonly pointer");
|
||||
delete this;
|
||||
return nullptr;
|
||||
}
|
||||
bool constflag = expr->ValueType->isPointer() && expr->ValueType->toPointer()->IsConst;
|
||||
expr = new FxTypeCast(expr, NewPointer(RUNTIME_CLASS(DObject), constflag), true, true);
|
||||
expr = expr->Resolve(ctx);
|
||||
if (expr == nullptr)
|
||||
|
|
Loading…
Reference in a new issue