Skip to content

Errors with 32bit target #69

@gnunicorn

Description

@gnunicorn

Running with an x86 32bit emulator I couldn't get this to work. even something as simple as echoing the same string back, like below, failed.

fn echo(inp: string) -> Result<string>;
pub fn echo(inp: String) -> Result<String> {
    Ok(String::from(inp))
}

It fails when trying to read back the result string:

E/flutter ( 4879): [ERROR:flutter/lib/ui/ui_dart_state.cc(209)] Unhandled Exception: Invalid argument(s): length must be in the range [0, 1073741823].
E/flutter ( 4879): #0      _checkExternalTypedDataLength (dart:ffi-patch/ffi_patch.dart:58:5)
E/flutter ( 4879): #1      Uint8Pointer.asTypedList (dart:ffi-patch/ffi_patch.dart:624:5)
E/flutter ( 4879): #2      Api.echo
package:sdk/sdk.dart:393
E/flutter ( 4879): #3      main
package:app/main.dart:9

And putting a print("${tmp10};${tmp11};${tmp12}"); into the generated dart-code also shows why: I/flutter ( 4879):-5868786620503136931;-5095886506439946255;-2008385391117589139 are really not valid pointer and size values. I think there's some type-mixup happening as the dart-code is looking at it with a 64bit data-lense while the code that is generated for 32bit rust uses i32 and u32 ...

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