Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MarshalIndent 方法内漏掉了对 extensions 的拷贝 #293

Closed
yelo-17133 opened this issue Jul 16, 2018 · 0 comments
Closed

MarshalIndent 方法内漏掉了对 extensions 的拷贝 #293

yelo-17133 opened this issue Jul 16, 2018 · 0 comments

Comments

@yelo-17133
Copy link

func (cfg *frozenConfig) MarshalIndent(v interface{}, prefix, indent string) ([]byte, error) {

newCfg := cfg.configBeforeFrozen
newCfg.IndentionStep = len(indent)
return newCfg.frozeWithCacheReuse().Marshal(v)

to:
newCfg := cfg.configBeforeFrozen
newCfg.IndentionStep = len(indent)
newFrozenCfg := newCfg.frozeWithCacheReuse();
newFrozenCfg.extensions = cfg.extensions
return newFrozenCfg.Marshal(v)

@taowen taowen closed this as completed in 10a568c Jul 22, 2018
zhenzou pushed a commit to zhenzou/jsoniter that referenced this issue Feb 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant