Skip to content

Commit

Permalink
Merge pull request polydawn#38 from Stebalien/fix/reset-tagged
Browse files Browse the repository at this point in the history
correctly reset Tagged, even if false
  • Loading branch information
warpfork committed Nov 1, 2018
2 parents 57f76af + 7409b45 commit 10eebc3
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 8 deletions.
7 changes: 3 additions & 4 deletions obj/marshalSlab.go
Original file line number Diff line number Diff line change
Expand Up @@ -173,10 +173,9 @@ func _yieldMarshalMachinePtrForAtlasEntry(row *marshalSlabRow, entry *atlas.Atla
// Pick delegate without growing stack. (This currently means recursive transform won't fly.)
row.marshalMachineTransform.delegate = _yieldMarshalMachinePtr(row, atl, entry.MarshalTransformTargetType)
// If tags are in play: have the transformer machine glue that on.
if entry.Tagged {
row.marshalMachineTransform.tagged = true
row.marshalMachineTransform.tag = entry.Tag
}

row.marshalMachineTransform.tagged = entry.Tagged
row.marshalMachineTransform.tag = entry.Tag
return &row.marshalMachineTransform
case entry.StructMap != nil:
row.marshalMachineStructAtlas.cfg = entry
Expand Down
6 changes: 2 additions & 4 deletions obj/marshalStruct.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,8 @@ func (mach *marshalMachineStructAtlas) Step(driver *Marshaller, slab *marshalSla
if mach.index < 0 {
tok.Type = TMapOpen
tok.Length = countEmittableStructFields(mach.cfg, mach.target_rv)
if mach.cfg.Tagged {
tok.Tagged = true
tok.Tag = mach.cfg.Tag
}
tok.Tagged = mach.cfg.Tagged
tok.Tag = mach.cfg.Tag
mach.index++
return false, nil
}
Expand Down

0 comments on commit 10eebc3

Please sign in to comment.