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

Pointer to local struct returned in core/encoding/xml/xml_reader.odin parse_bytes() #4705

Open
kovalenko0 opened this issue Jan 17, 2025 · 0 comments
Assignees

Comments

@kovalenko0
Copy link

kovalenko0 commented Jan 17, 2025

In parse_bytes :: proc

Line 178: t := &Tokenizer{} // local variable declared
Line 183: doc.tokenizer = t // local variable pointer assigned to a return value struct field
Line 388: return doc, .None // return value is returned with a pointer to a local struct

I can't formulate any suggestions on resolving this as I'm only learning Odin and system languages in general.

Please, address this if possible.

I encountered this when working on generic debug visualizer which accesses data based on runtime type information and it failed when reading doc.tokenizer.path as this memory was trampled over.

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

2 participants