Skip to content
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

src: fix -Wmaybe-uninitialized compiler warning #31809

Closed
wants to merge 2 commits into from

Commits on Feb 15, 2020

  1. Configuration menu
    Copy the full SHA
    d31b9bc View commit details
    Browse the repository at this point in the history
  2. src: fix -Wmaybe-uninitialized compiler warning

    Turn the `strategy_` method pointer into an enum-based static dispatch.
    
    It's both safer and more secure (no chance of method pointer corruption)
    and it helps GCC see that the shift and suffix tables it's complaining
    about are unused in single char search mode.
    
    Fixes the following warning:
    
        ../src/string_search.h:113:30: warning:
        ‘search’ may be used uninitialized in this function [-Wmaybe-uninitialized]
             return (this->*strategy_)(subject, index);
    
    Fixes: nodejs#26733
    Fixes: nodejs#31532
    Fixes: nodejs#31798
    bnoordhuis committed Feb 15, 2020
    Configuration menu
    Copy the full SHA
    ed8b671 View commit details
    Browse the repository at this point in the history