From a1028077377ad32f297991052c3e5b12c18ac543 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Sat, 4 Feb 2017 19:36:39 +0100 Subject: [PATCH] - atags for null pointers have no meaning so do not assert on them. --- src/scripting/vm/vmbuilder.cpp | 4 ++-- src/v_draw.cpp | 2 -- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/src/scripting/vm/vmbuilder.cpp b/src/scripting/vm/vmbuilder.cpp index 46553ab72..19fe81c32 100644 --- a/src/scripting/vm/vmbuilder.cpp +++ b/src/scripting/vm/vmbuilder.cpp @@ -281,8 +281,8 @@ unsigned VMFunctionBuilder::GetConstantAddress(void *ptr, VM_ATAG tag) AddrKonst *locp = AddressConstantMap.CheckKey(ptr); if (locp != NULL) { - // There should only be one tag associated with a memory location. - assert(locp->Tag == tag); + // There should only be one tag associated with a memory location. Exceptions are made for null pointers that got allocated through constant arrays. + assert(ptr == nullptr || locp->Tag == tag); return locp->KonstNum; } else diff --git a/src/v_draw.cpp b/src/v_draw.cpp index 8c66c3d38..a12b27bfc 100644 --- a/src/v_draw.cpp +++ b/src/v_draw.cpp @@ -523,8 +523,6 @@ bool DCanvas::ParseDrawTextureTags (FTexture *img, double x, double y, DWORD tag // doubles when passed as function arguments.) while (tag != TAG_DONE) { - DWORD data; - switch (tag) { default: