Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.
Sign upuse-after-free in `proc_macro` handle #56420
Comments
This comment has been minimized.
This comment has been minimized.
|
Macros aren't allowed to maintain state between calls. Given that you're not using |
This comment has been minimized.
This comment has been minimized.
gobanos
commented
Dec 1, 2018
|
Ok, so I should find a way to serialize data between calls. I think it should be a compile time error, if possible. Thanks for your time ! |
gobanos
closed this
Dec 1, 2018
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
gobanos commentedDec 1, 2018
•
edited
I'm the author of a proc_macro crate : https://github.com/gobanos/aoc-runner-derive, where I store
syn::Ident&Box<syn::Type>in athread_localHashMap.When I retrieve data from another proc_macro handle, an
use-after-freeerror occur.I tried this code:
Meta
rustc --version --verbose:rustc 1.32.0-nightly (d09466c 2018-11-30)
binary: rustc
commit-hash: d09466c
commit-date: 2018-11-30
host: x86_64-unknown-linux-gnu
release: 1.32.0-nightly
LLVM version: 8.0
PS: was working find few days ago :
rustc 1.32.0-nightly (edaac35 2018-11-24)
binary: rustc
commit-hash: edaac35
commit-date: 2018-11-24
host: x86_64-unknown-linux-gnu
release: 1.32.0-nightly
LLVM version: 8.0