Skip to content

Bug : segmentation fault #31

@pfeatherstone

Description

@pfeatherstone

Expected Behavior

We expect the following to work.

Actual Behavior

We get a segmentation fault.
It breaks when using local_storage and using move semantics.
The library just moves or swaps the underlying pointers. That won't work. Explicit move constructors MUST be called.
So I believe void_ptr should be upgraded to include:

  using ptr_t = void *;
  using del_t = void (*)(ptr_t);
  using copy_t = ptr_t (*)(ptr_t);
  using move_t = ptr_t(*)(ptr_t);
  
  ptr_t ptr;
  del_t del;
  copy_t copy;
  move_t move;

Steps to Reproduce the Problem

Run the godbolt link.

Specifications

Run on any system and it will break.

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