Assorted tiny bug fixes

This commit is contained in:
caheckman 2021-07-19 14:41:48 -04:00
parent ddb0dd06d9
commit d3fec7a944
7 changed files with 665 additions and 642 deletions

View file

@ -278,8 +278,9 @@ void Range::restoreXml(const Element *el,const AddrSpaceManager *manage)
{
spc = (AddrSpace *)0;
bool seenLast = false;
first = 0;
last = ~((uintb)0);
last = 0;
for(int4 i=0;i<el->getNumAttributes();++i) {
if (el->getAttributeName(i) == "space") {
spc = manage->getSpaceByName(el->getAttributeValue(i));
@ -295,6 +296,7 @@ void Range::restoreXml(const Element *el,const AddrSpaceManager *manage)
istringstream s(el->getAttributeValue(i));
s.unsetf(ios::dec | ios::hex | ios::oct);
s >> last;
seenLast = true;
}
else if (el->getAttributeName(i) == "name") {
const Translate *trans = manage->getDefaultCodeSpace()->getTrans();
@ -302,12 +304,16 @@ void Range::restoreXml(const Element *el,const AddrSpaceManager *manage)
spc = point.space;
first = point.offset;
last = (first-1) + point.size;
break; // There should be no (space,first,last) attributes
return; // There should be no (space,first,last) attributes
}
}
if (spc == (AddrSpace *)0)
throw LowlevelError("No address space indicated in range tag");
last = spc->wrapOffset(last);
throw LowlevelError("No address space indicated in range tag");
if (!seenLast) {
last = spc->getHighest();
}
if (first > spc->getHighest() || last > spc->getHighest() || last < first)
throw LowlevelError("Illegal range tag");
}
/// Insert a new Range merging as appropriate to maintain the disjoint cover

View file

@ -98,7 +98,7 @@ void IfcLoadFile::execute(istream &s)
if (capa->getName() == "xml") // If file is xml
dcp->conf->readLoaderSymbols("::"); // Read in loader symbols
#ifdef OPACTION_DEBUG
dcp->conf->setDebugStream(status->optr);
dcp->conf->setDebugStream(status->fileoptr);
#endif
*status->optr << filename << " successfully loaded: " << dcp->conf->getDescription() << endl;
}
@ -160,7 +160,7 @@ void IfcRestore::execute(istream &s)
}
#ifdef OPACTION_DEBUG
dcp->conf->setDebugStream(status->optr);
dcp->conf->setDebugStream(status->fileoptr);
#endif
*status->optr << savefile << " successfully loaded: " << dcp->conf->getDescription() << endl;
}

File diff suppressed because it is too large Load diff

View file

@ -545,7 +545,7 @@ with { BEGIN(pattern); withsection = 1; slgh->calcContextLayout(); return WITH
<defblock>[0-9]|[1-9][0-9]+ { return scan_number(yytext,&yylval,false); }
<defblock>0x[0-9a-fA-F]+ { return scan_number(yytext,&yylval,false); }
<defblock>0b[01]+ { return scan_number(yytext,&yylval,false); }
<defblock>\"([^\"]|\"\")*\" { yylval.str = new string(yytext+1,strlen(yytext)-2); return STRING; }
<defblock>\"([^\"[:cntrl:]]|\"\")*\" { yylval.str = new string(yytext+1,strlen(yytext)-2); return STRING; }
<defblock>[\r\ \t\v]+
<defblock>\n { slgh->nextLine(); }
<defblock>. { return yytext[0]; }
@ -557,7 +557,7 @@ with { BEGIN(pattern); withsection = 1; slgh->calcContextLayout(); return WITH
<print>\^ { yylval.ch = '^'; return '^'; }
<print>is { BEGIN(pattern); actionon=0; return IS_KEY; }
<print>[a-zA-Z_.][a-zA-Z0-9_.]* { yylval.str = new string(yytext); return SYMBOLSTRING; }
<print>\"([^\"]|\"\")*\" { yylval.str = new string(yytext+1,strlen(yytext)-2); return STRING; }
<print>\"([^\"[:cntrl:]]|\"\")*\" { yylval.str = new string(yytext+1,strlen(yytext)-2); return STRING; }
<print>[\r\ \t\v]+ { yylval.ch = ' '; return ' '; }
<print>\n { slgh->nextLine(); return ' '; }
<print>. { return yytext[0]; }