jac3km4 / redscript

Compiler/decompiler toolkit for redscript
MIT License
408 stars 37 forks source link

Lint hangs when @wrapMethod is used with an incorrect header #58

Closed jackhumbert closed 9 months ago

jackhumbert commented 3 years ago

This is similar to the block I had in my code, which caused lint to hang and grow in size until memory limits were reached:

@wrapMethod(hudCarController)
protected cb func OnRpmValueChanged()  -> Void {
  wrappedMethod();
}

Just for reference, this is the correct header that returns as normal;

@wrapMethod(hudCarController)
protected cb func OnRpmValueChanged(rpmValue: Float)  -> Void {
  wrappedMethod(rpmValue);
}

Thanks for all your work on this!

jac3km4 commented 3 years ago

good catch, this seems to be an issue with cb and native functions - the way they're matched (using function signatures) in this case ignores the function parameter types which can lead to the compiler accepting invalid code like this and then getting stuck at a later stage

jac3km4 commented 9 months ago

the lint doesn't hang anymore, it fails with an error (although not a very good one), but I think this can be closed