forked from mirror/go-json
work cover test
This commit is contained in:
parent
a5bf94c75b
commit
7e0bfb4f54
|
@ -229,6 +229,7 @@ func (c *SliceCode) ToOpcode(ctx *compileContext) Opcodes {
|
||||||
header := newSliceHeaderCode(ctx)
|
header := newSliceHeaderCode(ctx)
|
||||||
ctx.incIndex()
|
ctx.incIndex()
|
||||||
codes := c.value.ToOpcode(ctx.incIndent())
|
codes := c.value.ToOpcode(ctx.incIndent())
|
||||||
|
codes.First().Flags |= IndirectFlags
|
||||||
elemCode := newSliceElemCode(ctx.withType(c.typ.Elem()), header, size)
|
elemCode := newSliceElemCode(ctx.withType(c.typ.Elem()), header, size)
|
||||||
ctx.incIndex()
|
ctx.incIndex()
|
||||||
end := newOpCode(ctx, OpSliceEnd)
|
end := newOpCode(ctx, OpSliceEnd)
|
||||||
|
@ -262,6 +263,7 @@ func (c *ArrayCode) ToOpcode(ctx *compileContext) Opcodes {
|
||||||
ctx.incIndex()
|
ctx.incIndex()
|
||||||
|
|
||||||
codes := c.value.ToOpcode(ctx.incIndent())
|
codes := c.value.ToOpcode(ctx.incIndent())
|
||||||
|
codes.First().Flags |= IndirectFlags
|
||||||
|
|
||||||
elemCode := newArrayElemCode(ctx.withType(elem), header, alen, size)
|
elemCode := newArrayElemCode(ctx.withType(elem), header, alen, size)
|
||||||
ctx.incIndex()
|
ctx.incIndex()
|
||||||
|
@ -300,6 +302,7 @@ func (c *MapCode) ToOpcode(ctx *compileContext) Opcodes {
|
||||||
value := newMapValueCode(ctx, header)
|
value := newMapValueCode(ctx, header)
|
||||||
ctx.incIndex()
|
ctx.incIndex()
|
||||||
valueCodes := c.value.ToOpcode(ctx.incIndent())
|
valueCodes := c.value.ToOpcode(ctx.incIndent())
|
||||||
|
valueCodes.First().Flags |= IndirectFlags
|
||||||
|
|
||||||
key := newMapKeyCode(ctx, header)
|
key := newMapKeyCode(ctx, header)
|
||||||
ctx.incIndex()
|
ctx.incIndex()
|
||||||
|
|
Loading…
Reference in New Issue