-
-
Notifications
You must be signed in to change notification settings - Fork 378
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Please include support for zerolog Panic (nil pointer check) #793
Comments
Hi @dominikh |
I think that that was discussed somewhere else, but perhaps a list of fully-qualified identifier names of terminating functions could be added to |
I found this in docs. Lines 22 to 60 in 82c7dc9
And staticcheck only supports logrus. I think zerolog can be added. @ainar-g Could you give guide how to add terminating functions to configuration? |
@dlsrb6342, I cannot provide any guides, since the feature doesn't exist yet. My comment was merely a proposal to add it. |
Prototype for adding a new
The value indicates if the fn.NoReturn = irAlwaysUnwinds (rather than ir.AlwaysExits). Few bits need to be done, and should move that switch to the default config, but seems to work. Any feedback on this approach @dominikh before I work on this further? |
I don't think I want to make this configurable. This information affects how the IR gets built, and incorrect settings could lead to incorrect IR and hard to diagnose problems. |
Can just add zerolog to that list I guess, but would be nice to configure this. I don't see a huge potential for failure here, as it checks functions it finds against the configuration (rather than using the config as direct input). So the worst is you end up with a fatal function that's not fatal. Some junk values is not going to cause Weird Stuff™ to happen. |
Which affects all IR-based analyzes that try to reason about the control flow of code after a non-fatal fatal function gets called. |
It's just that I don't see how someone could accidentally get this wrong by a typo or misunderstanding. Personally I would say that adding non-exiting functions here fits in the "that's just stupid, don't do that"-category. But no worries, it hasn't come up that often so probably not that big of a deal. Although with e.g. #1526 it might be a bit more of a deal. |
Please add support for zerolog "Panic" to avoid triggering "SA5011: possible nil pointer dereference".
The text was updated successfully, but these errors were encountered: