Skip to content

Host array of eq is incorrect #136

Closed
@polarathene

Description

@polarathene

When doing an eq or neq on two Arrays, print() will give the expected result such as [0, 1, 0], when moved to the host I would see [256, 0, 0]. For neq [1, 0, 1] would convert to [65537, 0, 0].

let length = result.elements() as usize;
let mut rdata: Vec<u32> = vec![0; length];
result.host::<u32>(&mut rdata);

I've found out changing u32 to u8 gives the correct array values. The docs don't mention the Array returned is u8. I'm not familiar enough with Rust but would assume if the output for eq/neq is always in u8 values that could be typed and the compiler would pick up on it for the developer to understand what happened?

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