From a05029b3a7d47c1d9ba737f2a869c22c1b358126 Mon Sep 17 00:00:00 2001 From: ac_stef Date: Sat, 20 Dec 2008 00:07:38 +0000 Subject: [PATCH] fixed illegal last() in secure context stack git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@4047 e016b1c5-ed68-44aa-a2f7-31cac88cffde --- source/src/command.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/source/src/command.cpp b/source/src/command.cpp index 7b0234a5..c4bda502 100644 --- a/source/src/command.cpp +++ b/source/src/command.cpp @@ -919,14 +919,15 @@ void identnames(vector &names, bool builtinonly) void pushscontext(int newcontext) { - contextstack.add((execcontext = newcontext)); + contextstack.add(execcontext); + execcontext = newcontext; } int popscontext() { ASSERT(contextstack.length() > 0); - int old = contextstack.pop(); - execcontext = contextstack.last(); + int old = execcontext; + execcontext = contextstack.pop(); if(execcontext < old && old >= IEXC_MAPCFG) // clean up aliases created in the old (map cfg) context {