mirror of https://github.com/stella-emu/stella.git
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
This commit is contained in:
parent
8476dcd6d1
commit
10298d8ba2
|
@ -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 <string>
|
||||
|
@ -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));
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue