LLVM enabled compiler crashes on argument assignment from nested function

Summary

System Information

  • Operating system: Linux, Ubuntu 22.04
  • Processor architecture: x86-64, clang-14
  • Compiler version: 3.3.1, hash 5462dd38

Steps to reproduce

To reproduce is just needed to compile with -MDelphi enabled. Without it, code compiles just fine.

Example Project

Program test;

procedure outer_proc(var outer: ShortString);

procedure inner_proc;
Begin
  outer := 'abc';
End;

Begin
  inner_proc();
End;

var
 s: shortstring;

Begin
  outer_proc(s);
End.

What is the current bug behavior?

Free Pascal Compiler version 3.3.1 [2025/05/13] for x86_64
Copyright (c) 1993-2025 by Florian Klaempfl and others
Target OS: Linux for x86-64
Compiling /root/test.pas
Error: Compilation raised exception internally
Fatal: Compilation aborted
An unhandled exception occurred at $000000000061B304:
EAccessViolation: Access violation
  $000000000061B304
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information