Skip to content

DerefOf probably doesn't work on Object::Reference #272

@martin-hughes

Description

@martin-hughes

Attempting to run the aml_tester against my machine's SSDT generated this error:

Error running test: ObjectNotOfExpectedType { expected: Reference, got: BufferField }

Taking a look at src/aml/mod.rs:808 onwards I can see the code expects a reference:

let result = if object.typ() == ObjectType::Reference {

But I don't think Object::typ() can return ObjectType::Reference - it recurses through to find the least innermost non-Reference object's type.

On my machine, the failing code is generating a reference to a buffer field - so Object::typ() is returning ObjectType::BufferField.

Unless I'm being daft, the code on line 811 (object.clone().unwrap_reference()) is unreachable.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions