Merge remote-tracking branch 'origin/GP-1915_PrototypeModelInjectionFix' into patch

This commit is contained in:
Ryan Kurtz 2022-04-17 06:09:14 -04:00
commit 34efe94fce
2 changed files with 8 additions and 2 deletions

View file

@ -637,7 +637,13 @@ public class SpecExtension {
} }
cspecValidator.verify(res.optionName, document); cspecValidator.verify(res.optionName, document);
checkExtension(res); checkExtension(res);
parseExtension(res.optionName, document, program.getCompilerSpec(), false); if (!(program.getCompilerSpec() instanceof BasicCompilerSpec)) {
throw new SleighException(
"Can only test specification extensions against SLEIGH program");
}
BasicCompilerSpec cSpecCopy =
new BasicCompilerSpec((BasicCompilerSpec) program.getCompilerSpec());
parseExtension(res.optionName, document, cSpecCopy, false);
return res; return res;
} }

View file

@ -163,7 +163,7 @@ public class BasicCompilerSpec implements CompilerSpec {
* spec from Language. * spec from Language.
* @param op2 is the spec to clone * @param op2 is the spec to clone
*/ */
protected BasicCompilerSpec(BasicCompilerSpec op2) { public BasicCompilerSpec(BasicCompilerSpec op2) {
language = op2.language; language = op2.language;
description = op2.description; description = op2.description;
// PrototypeModel is immutable but the map may change, so callingConventionMap // PrototypeModel is immutable but the map may change, so callingConventionMap