Skip to content

Make ConstAccessorSimple safe #356

@JamesMcClung

Description

@JamesMcClung

The following is currently unsafe:

int p = 0; // patch index
auto prts = mprts.accessor()[p]; // unsafe

// <- result of `mprts.accessor()` may be dropped here

prts.size() // seg fault if drop happened

The above seg fault happened in #354, and was ostensibly fixed in #355, but that fix was incompatible with CUDA.

For now, the safe alternative is:

auto acc = mprts.accessor();
auto prts = acc[p];
// safe to do whatever

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