Skip to content

mvm_toStringUtf8 fails on float numbers #68

Closed
@boogie

Description

@boogie

I am working with numbers, sometimes I have a float to console.log. Currently the microvium code aborts when I'm calling mvm_toStringUtf8 on a float number. Which might be OK, and I'm looking for a workaround now.

It seems that internally vm_convertToString returns 0xFFFF instead of a string pointer, and then an assert fails.

I'm trying to check the type of the value before calling mvm_toStringUtf8 to recognize if it's a float number, but it returns a generic number type, so I cannot decide if it's an integer or float. I've patched the code now and mvm_toStringUtf8 returns "[Float]", but maybe you can recommend a better workaround?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions