Skip to content

Undefined behavior #175

@umanwizard

Description

@umanwizard

This test segfaults reliably on v0.13.0:

#[cfg(test)]
mod tests {
    use capstone::Capstone;
    use capstone::arch::{BuildsCapstone, DetailsArchInsn};

    #[test]
    fn capstone_segfaults() {
        let cs = Capstone::new()
            .arm64()
            .detail(true)
            .mode(capstone::arch::arm64::ArchMode::Arm)
            .build()
            .unwrap();

        let insns = cs.disasm_all(&[0x0c, 0x44, 0x3b, 0xd5], 0).unwrap();
        for i in insns.as_ref() {
            let id = cs.insn_detail(&i).unwrap();
            let ad = id.arch_detail();
            let aarch = ad.arm64().unwrap();

            println!("{i} (dt: {:?})", aarch.operands().collect::<Vec<_>>());
        }
    }
}

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