Skip to content

Inconsistent AlignToPtr use #309

@User4martin

Description

@User4martin

Getting the next opcode is sometimes done with PRENextOff(AlignToPtr(scan + REOpSz))^ and sometimes Inc(s, REOpSz + RENextOffSz)

It doesn't fail on many arch:

function AlignToPtr(const p: Pointer): Pointer; {$IFDEF InlineFuncs}inline;{$ENDIF}
begin
  {$IFDEF FPC_REQUIRES_PROPER_ALIGNMENT}
  Result := Align(p, SizeOf(Pointer));
  {$ELSE}
  Result := p;
  {$ENDIF}
end;

But compile on an arch that requires align, and it should fail

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