vavoomc: fixed a nasty bug with optional TVec params (GREAT thanks to TDRR for help...
commitf045072c8372e6073f08bede32f4e95dcb6d3874
authorketmar <ketmar@ketmar.no-ip.org>
Mon, 16 Oct 2023 03:43:56 +0000 (16 03:43 +0000)
committerketmar <ketmar@ketmar.no-ip.org>
Mon, 16 Oct 2023 03:43:56 +0000 (16 03:43 +0000)
treec636b16f48c7e95202188eeacc6ca1394a961ec2
parent7f1c4efe931a51736fc60d9f7eeeca571a4ca09f
vavoomc: fixed a nasty bug with optional TVec params (GREAT thanks to TDRR for help and patience!)

  it was a nasty thing which sits in the compiler for years. see, each `TVec`
  param needs a "vector fix" instruction inserted in the method prologue.
  the compiler did that by scanning all local variables created for method
  params. yet it did check param flags from the original declaration.

  now, for optional params, the compiler inserts invisible "specified_xxx" args.
  so the loop over all created locals would happily desync when there are
  optional params present. which is not a disaster... unless we need to fix
  some TVec.

  everything worked so far only due to a sheer luck. and recent `LineAttack()`
  change managed to make the engine crash... but only on 64-bit systems. and
  i am using 32-bit system, where it worked (again, by accident).

  many thanks to TDRR, for spending hours (days? ;-) doing "git bisect" for me.

  happy hacking, and don't forget to check your indices, people! ;-)

FossilOrigin-Name: dc08e3c6e6f450f27b78ced50b907fc7a21ae00671e8da21a7193de956658e77
libs/vavoomc/vc_executor.cpp
libs/vavoomc/vc_expr_invoke.cpp
libs/vavoomc/vc_method.cpp
libs/vavoomc/vc_method.h
libs/vavoomc/vc_modifiers.h
libs/vavoomc/vc_parser.cpp