mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2025-10-04 10:19:23 +02:00
Merge remote-tracking branch 'origin/patch'
This commit is contained in:
commit
e149d04ca8
2 changed files with 11 additions and 7 deletions
|
@ -572,7 +572,7 @@ macrodef
|
||||||
}
|
}
|
||||||
: ^(t=OP_MACRO n=unbound_identifier["macro"] a=arguments {
|
: ^(t=OP_MACRO n=unbound_identifier["macro"] a=arguments {
|
||||||
symbol = sc.createMacro(find(n), n.getText(), a.first, a.second);
|
symbol = sc.createMacro(find(n), n.getText(), a.first, a.second);
|
||||||
} s=semantic[env, sc.pcode, $t, false, true]) {
|
} s=semantic[env, null, sc.pcode, $t, false, true]) {
|
||||||
if (symbol != null) {
|
if (symbol != null) {
|
||||||
sc.buildMacro(symbol, $macrodef::macrobody);
|
sc.buildMacro(symbol, $macrodef::macrobody);
|
||||||
}
|
}
|
||||||
|
@ -621,13 +621,13 @@ constructorlikelist
|
||||||
;
|
;
|
||||||
|
|
||||||
constructor
|
constructor
|
||||||
: ^(OP_CONSTRUCTOR c=ctorstart e=bitpattern b=contextblock r=ctorsemantic) {
|
: ^(OP_CONSTRUCTOR c=ctorstart e=bitpattern b=contextblock r=ctorsemantic[c]) {
|
||||||
sc.buildConstructor(c, e, b, r);
|
sc.buildConstructor(c, e, b, r);
|
||||||
}
|
}
|
||||||
;
|
;
|
||||||
|
|
||||||
ctorsemantic returns [SectionVector value]
|
ctorsemantic[Constructor ctor] returns [SectionVector value]
|
||||||
: ^(t=OP_PCODE p=semantic[env, sc.pcode, $t, true, false]) { $value = p; }
|
: ^(t=OP_PCODE p=semantic[env, ctor.location, sc.pcode, $t, true, false]) { $value = p; }
|
||||||
| ^(OP_PCODE OP_UNIMPL) { /*unimpl unimplemented ; */ $value = null; }
|
| ^(OP_PCODE OP_UNIMPL) { /*unimpl unimplemented ; */ $value = null; }
|
||||||
;
|
;
|
||||||
|
|
||||||
|
@ -950,7 +950,7 @@ cstatement[VectorSTL<ContextChange> r]
|
||||||
}
|
}
|
||||||
;
|
;
|
||||||
|
|
||||||
semantic[ParsingEnvironment pe, PcodeCompile pcode, Tree where, boolean sectionsAllowed, boolean isMacroParse] returns [SectionVector rtl]
|
semantic[ParsingEnvironment pe, Location containerLoc, PcodeCompile pcode, Tree where, boolean sectionsAllowed, boolean isMacroParse] returns [SectionVector rtl]
|
||||||
scope {
|
scope {
|
||||||
SectionVector sections;
|
SectionVector sections;
|
||||||
boolean containsMultipleSections;
|
boolean containsMultipleSections;
|
||||||
|
@ -975,7 +975,11 @@ semantic[ParsingEnvironment pe, PcodeCompile pcode, Tree where, boolean sections
|
||||||
: ^(x=OP_SEMANTIC c=code_block[find($x)] {
|
: ^(x=OP_SEMANTIC c=code_block[find($x)] {
|
||||||
if (c != null) {
|
if (c != null) {
|
||||||
if (c.getOpvec().empty() && c.getResult() == null) {
|
if (c.getOpvec().empty() && c.getResult() == null) {
|
||||||
pcode.recordNop(find(where));
|
Location loc = find(where);
|
||||||
|
if (loc == null) {
|
||||||
|
loc = containerLoc;
|
||||||
|
}
|
||||||
|
pcode.recordNop(loc);
|
||||||
}
|
}
|
||||||
if ($semantic::containsMultipleSections) {
|
if ($semantic::containsMultipleSections) {
|
||||||
$semantic::sections = pcode.finalNamedSection($semantic::sections, c);
|
$semantic::sections = pcode.finalNamedSection($semantic::sections, c);
|
||||||
|
|
|
@ -312,7 +312,7 @@ public class PcodeParser extends PcodeCompile {
|
||||||
// ANTLRUtil.debugNodeStream(nodes, System.out);
|
// ANTLRUtil.debugNodeStream(nodes, System.out);
|
||||||
SleighCompiler walker = new SleighCompiler(nodes);
|
SleighCompiler walker = new SleighCompiler(nodes);
|
||||||
|
|
||||||
SectionVector rtl = walker.semantic(env, this, semantic.getTree(), false, false);
|
SectionVector rtl = walker.semantic(env, null, this, semantic.getTree(), false, false);
|
||||||
|
|
||||||
if (getErrors() != 0) {
|
if (getErrors() != 0) {
|
||||||
return null;
|
return null;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue