xNVSE / NVSE

New Vegas Script Extender (NVSE)

Home Page:https://git.io/JfSAo

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Functions can have junk extra args passed

Demorome opened this issue · comments

Since this seems like a doozy to fix rn, I'm keeping this issue tracked for later.

Issue is: Inside vanilla (non-eval) if-checks, you can pass as many args as you want to a function and it'll compile in a messed up state, crashing the script. Probably a vanilla bug.

However, a probably separate instance of the same bug happens inside inline expressions, though when compiling it luckily ignore the extra args and behaves fine otherwise. Still, it should probably warn users they're passing too many args there.

ExpressionParser::ParseArgs probably mishandles it for inline expressions (?). Code's a bit dense and recursive though.

Here's a script file with all the test cases I've written, commented-out text won't compile.
TestPassingExtraArgBug.txt