Skip to content

Access Violation exception when filling an array element #61

@gynt

Description

@gynt
cffi.cdef([[
  struct A {
    int a;
    int b;
  };
]])

array = cffi.new("struct A[10]", {})
element = array[4]
cffi.fill(element, cffi.sizeof("struct A"), 0) -- access violation

To avoid this, I have to use cffi.addressof:

cffi.fill(cffi.addressof(element), cffi.sizeof("struct A"), 0) -- no access violation

Windows 11, lua x86 5.4.6

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions