Skip to content

use-after-free in proc_macro handle #56420

Closed
@gobanos

Description

@gobanos

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 a thread_local HashMap.
When I retrieve data from another proc_macro handle, an use-after-free error occur.

I tried this code:

#[aoc_generator(...)] // <- store name & output type in a map
fn gen(input: &str) -> Vec<i32> {
    ...
}

#[aoc(...)] // <- retrieve them from the map
fn run(input: &[i32]) -> i32 {
    ...
}

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions