Skip to content

[Bug Fix] Fixed issue where Val shortcutting (!565) would not compile under 32-bit systems

J. Gareth "Kit" Moreton requested to merge CuriousKit/optimisations:val-fix into main

Summary

This merge request fixes an issue where the ValCode variable was defined as TCGInt and would cause a type mismatch error under i386-win32, and presumably other 32-bit operating systems. Because this corresponds to the Code output parameter of Val, changing it to Word (as documentation implies: https://www.freepascal.org/docs-html/rtl/system/val.html) instead won't cause non-trivially different behaviour on different architectures as it is just a string index and valid numbers can't currently be longer than 20 characters or so (much shorter than even a Byte).

System

  • Processor architecture: Anything that isn't 64-bit

What is the current bug behavior?

Compiler doesn't build properly on non-64-bit platforms.

What is the behavior after applying this patch?

Compiler builds on non-64-bit platforms without issue.

Edited by J. Gareth "Kit" Moreton

Merge request reports