Skip to content

Crash when appending to _vec.alloc'ed vector #109

Closed
@jyasskin

Description

@jyasskin

The following code crashes inside of glue$copy$s, I believe when trying to decrement a refcount. The crash goes away if I don't use std._vec.alloc, if I change 'str' to 'int', or if the 'str' isn't a type parameter.

use std;

fn slice[T](vec[T] e) {
  let vec[T] result = std._vec.alloc[T](uint(1));
  result += e;
}

fn main() {
  slice[str](vec("a"));
}

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