From 10298d8ba25a60d465a2885909520b5bd50a3355 Mon Sep 17 00:00:00 2001 From: urchlay Date: Thu, 14 Jul 2005 15:28:51 +0000 Subject: [PATCH] Fix EquateList so labels can correctly be redefined. At this point, you should be able to do this: > define foo 1 > expr foo+1 result: 2 > define foo 2 > expr result: 3 > undef foo > expr result: 0 <-- because undefined labels are treated as -1. Bug? git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@646 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba --- stella/src/debugger/EquateList.cxx | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/stella/src/debugger/EquateList.cxx b/stella/src/debugger/EquateList.cxx index 1fc39b695..922b6ef53 100644 --- a/stella/src/debugger/EquateList.cxx +++ b/stella/src/debugger/EquateList.cxx @@ -13,7 +13,7 @@ // See the file "license" for information on usage and redistribution of // this file, and for a DISCLAIMER OF ALL WARRANTIES. // -// $Id: EquateList.cxx,v 1.17 2005-07-12 02:27:06 urchlay Exp $ +// $Id: EquateList.cxx,v 1.18 2005-07-14 15:28:51 urchlay Exp $ //============================================================================ #include @@ -153,8 +153,6 @@ int EquateList::getAddress(const string& label) { } bool EquateList::undefine(string& label) { - return false; - labelToAddr::iterator iter = myFwdMap.find(label); if(iter == myFwdMap.end()) { return false; @@ -222,6 +220,7 @@ string EquateList::loadFile(string file) { } void EquateList::addEquate(string label, int address) { + undefine(label); myFwdMap.insert(make_pair(label, address)); myRevMap.insert(make_pair(address, label)); }