fix(extract): resolve Go route paths built via string concatenation - #1400
Open
AmirF194 wants to merge 1 commit into
Open
fix(extract): resolve Go route paths built via string concatenation#1400AmirF194 wants to merge 1 commit into
AmirF194 wants to merge 1 commit into
Conversation
r.HandleFunc(base+"/login", handler) fell through extract_positional_url with no branch for binary_expression, so first_string_arg stayed NULL. A real BFF with 47 such registrations (all base+"literal") produced only 9 Route nodes. Recover the literal suffix from the right-hand operand of a "+" concatenation; a right side that is not itself a literal is left unresolved rather than guessed. Fixes DeusData#1249 Signed-off-by: Amir Fathi <amirfathi.me@gmail.com>
|
Thanks for opening this — it has been seen, and it is queued. This note is automated, but it is not a brush-off: it exists so you know where your PR stands instead of having to guess from silence. Current review status: working through a backlog. What that means for this PR, concretely:
Things that will genuinely speed it up whenever review does happen:
If this fixes a bug, a reproduction we can run is worth more than a description of the symptom. Thanks for contributing, and sorry in advance for the wait. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do?
r.HandleFunc(base+"/login", loginHandler)and outbound calls built the same way ("http://" + host + ":" + port + "/log") were not indexed:extract_positional_url(internal/cbm/extract_calls.c) has no branch forbinary_expression, the AST node Go's+produces, so the argument falls through andfirst_string_argstays NULL. On the reporter's real BFF (47HandleFuncregistrations, allBaseURL+"literal"), the graph contained only 9 Route nodes.Added
extract_binary_concat_suffix: for a+concatenation, recover the literal string on the right-hand side (the config-prefix pattern this issue describes). When the right side is not itself a literal, the call is left unresolved rather than guessing a path, matching the reporter's own expected behavior.Checklist
git commit -s)make -f Makefile.cbm test)make -f Makefile.cbm lint-ci)Verification
extract_go_binary_concat_url_issue1249) fails on unmodifiedmain(first_string_arg is NULL) and passes on this branch, covering both the mux registration and the outbound-URL case from the issue.base+suffixVar) still resolves to no route, so nothing is fabricated.extractionsuite (273 tests) passes under ASan+UBSan;scripts/lint.sh --ci(cppcheck + clang-format) is clean on the changed files.extraction, and the macOS/Windows CI legs (no such runners here).Fixes #1249