1
0
mirror of https://github.com/fadden/6502bench.git synced 2024-07-06 16:29:03 +00:00

Don't create bad DefSymbol

When editing an instruction operand, if you click "edit project
symbol", we need an initial value for the label.  If you started
typing something in the instruction operand symbol field, we use
that.  Unfortunately we were trying to use that even when it was
invalid, which caused an assertion to go off in the DefSymbol
constructor.
This commit is contained in:
Andy McFadden 2020-01-25 18:23:27 -08:00
parent 44568f71ef
commit 589ff9bb36

View File

@ -1005,8 +1005,9 @@ namespace SourceGen.WpfGui {
if (origSym == null) {
// Need to start with a symbol so we can set the value field.
string symName = "SYM";
if (!string.IsNullOrEmpty(SymbolLabel)) {
symName = SymbolLabel; // may not be valid, but it doesn't have to be
if (!string.IsNullOrEmpty(SymbolLabel) &&
Asm65.Label.ValidateLabel(SymbolLabel)) {
symName = SymbolLabel;
}
origSym = new DefSymbol(symName, mOperandValue, Symbol.Source.Project,
Symbol.Type.ExternalAddr, FormatDescriptor.SubType.None);