Skip to content

virtual-function-elimination leads to unstable assembly code #2

@Jujstme

Description

@Jujstme

As described in the book, VFE tends to remove vtable functions too eagerly, leading to miscompilations, with situations that will trigger panics despite using completely safe code.

An example is provided by the following code, which is completely safe and correct from a language standpoint on std, but will trigger a panic upon calling the .to_string() function

image-22

In these cases you might want to remove the flag declared in here altogether.

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