Skip to content

UB in inline-asm delay function #195

Closed
@ByteNacked

Description

@ByteNacked

UB in higher opt levels with inline-asm feature, caused by forgotten asm clobber in asm::delay function.

Example fix:

asm!("1:
      nop
      subs $0, $$1
      bne.n 1b"
      : "+r"(_n / 4 + 1)
      :
      :
      : "cpsr" // <= Added here
      : "volatile");

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions