File tree Expand file tree Collapse file tree 1 file changed +19
-17
lines changed Expand file tree Collapse file tree 1 file changed +19
-17
lines changed Original file line number Diff line number Diff line change @@ -202,18 +202,22 @@ func (p *Linker) linkInstruction(insn macro.Instruction, buses map[uint]io.Bus)
202202 //
203203 return p .linkExprs (insn .Sources )
204204 case * macro.IfGoto :
205- value , errmsg := p .getLabelValue (insn .Label )
206- if errmsg != "" {
207- return p .srcmap .SyntaxError (insn , errmsg )
208- } else {
209- insn .Constant = value
205+ if insn .Label != "" {
206+ value , errmsg := p .getLabelValue (insn .Label )
207+ if errmsg != "" {
208+ return p .srcmap .SyntaxError (insn , errmsg )
209+ } else {
210+ insn .Constant = value
211+ }
210212 }
211213 case * macro.IfThenElse :
212- value , errmsg := p .getLabelValue (insn .Label )
213- if errmsg != "" {
214- return p .srcmap .SyntaxError (insn , errmsg )
215- } else {
216- insn .Right = value
214+ if insn .Label != "" {
215+ value , errmsg := p .getLabelValue (insn .Label )
216+ if errmsg != "" {
217+ return p .srcmap .SyntaxError (insn , errmsg )
218+ } else {
219+ insn .Right = value
220+ }
217221 }
218222 default :
219223 // continue
@@ -265,13 +269,11 @@ func (p *Linker) getLabelValue(l string) (big.Int, string) {
265269 //
266270 var ok bool
267271 //
268- if l != "" {
269- deats , ok = p .constmap [module .NewName (l , 1 )]
270- //
271- if ! ok {
272- msg := fmt .Sprintf ("unknown register or constant \" %s\" " , l )
273- return big.Int {}, msg
274- }
272+ deats , ok = p .constmap [module .NewName (l , 1 )]
273+ //
274+ if ! ok {
275+ msg := fmt .Sprintf ("unknown register or constant \" %s\" " , l )
276+ return big.Int {}, msg
275277 }
276278 //
277279 return deats .Left , ""
You can’t perform that action at this time.
0 commit comments