Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Bug: winrt::box_value(std::wstring_view(...)) may cause abort #1527

Copy link
Copy link
@justanotheranonymoususer

Description

Version

No response

Summary

I'm bitten by this for the second time, and it's not pleasant to debug. I have code like:

Blabla(winrt::box_value(GetStringView(...)));

It seems that if GetStringView returns std::wstring_view which happens to end with a null terminator, it works, but if not, then abort is called and the app crashes.

Ideally it should just work correctly. Less ideally, it shouldn't compile without an explicit hstring(...) conversion. Even less ideally, it should always crash. But now, it crashes only in the less common cases, which bits me in the most inconvenient times.

I don't have an isolated repro right now, I'm working on a large codebase, let me know if you need one.

Reproducible example

Expected behavior

No response

Actual behavior

No response

Additional comments

No response

Reactions are currently unavailable

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

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.