This commit is contained in:
Masaaki Goshima 2021-11-27 22:33:45 +09:00
parent 0472aebe51
commit 67cb2b9a75
No known key found for this signature in database
GPG Key ID: 6A53785055537153
2 changed files with 3 additions and 16 deletions

View File

@ -732,6 +732,9 @@ func (c *InterfaceCode) ToOpcode(ctx *compileContext) Opcodes {
default: default:
code = newOpCode(ctx.withType(c.typ), OpInterface) code = newOpCode(ctx.withType(c.typ), OpInterface)
} }
if c.typ.NumMethod() > 0 {
code.Flags |= NonEmptyInterfaceFlags
}
ctx.incIndex() ctx.incIndex()
return Opcodes{code} return Opcodes{code}
} }

View File

@ -697,22 +697,6 @@ func newMapEndCode(ctx *compileContext, head *Opcode) *Opcode {
} }
} }
func newInterfaceCode(ctx *compileContext) *Opcode {
var flag OpFlags
if ctx.typ.NumMethod() > 0 {
flag |= NonEmptyInterfaceFlags
}
return &Opcode{
Op: OpInterface,
Idx: opcodeOffset(ctx.ptrIndex),
Next: newEndOp(ctx),
Type: ctx.typ,
DisplayIdx: ctx.opcodeIndex,
Indent: ctx.indent,
Flags: flag,
}
}
func newRecursiveCode(ctx *compileContext, jmp *CompiledCode) *Opcode { func newRecursiveCode(ctx *compileContext, jmp *CompiledCode) *Opcode {
return &Opcode{ return &Opcode{
Op: OpRecursive, Op: OpRecursive,