Skip to content

op2 should report an error when a reentrant op has a &[mut] OpState parameter #1252

@petamoriken

Description

@petamoriken

A &mut OpState parameter will cause the OpState to be borrowed exclusively for the entirety of an op call, but this function can call user code during IDL conversions, which can in turn call other ops that also attempt to borrow the OpState. To fix this, the type of the state parameter needs to be changed to Rc<RefCell<OpState>>, and the borrow as short-lived as possible.

denoland/deno#27527 (comment)

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