Skip to content
This repository was archived by the owner on Aug 24, 2022. It is now read-only.
This repository was archived by the owner on Aug 24, 2022. It is now read-only.

Unsafe pointer from string #860

Description

@iskiselev

Looks like JSIL doesn't support resolving pointer from string. Here is test case:

using System;

static class Program {
    public static void Main () {
        string str = "qww";
        unsafe
        {
            fixed (char* sPtr = str)
            {
                *sPtr = 'a';
            }
        }

        Console.WriteLine(str);
    }
}

Translation result:

    var sPtr = JSIL.UntranslatableInstruction("Implicit conversion to pointer: Untranslatable Expression Conversion of expression '@<var System.String str>' to pointer");
    sPtr.set(("a").charCodeAt(0));
    $T00().WriteLine("qww");

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions