IRSA-7633 prevent strings from being misclassified as arrays in variant visitor#5
IRSA-7633 prevent strings from being misclassified as arrays in variant visitor#5sreenivasapydi wants to merge 2 commits intoCaltech-IPAC:masterfrom
Conversation
|
Hi, @sreenivasapydi. Looks good. Please check whether making this change to json5_parser/json5_parser_reader_template.h addresses the compiler warnings: If it looks good to you, would you mind adding this change to your branch? Thanks. |
judith-ipac
left a comment
There was a problem hiding this comment.
Looks good. Please see my suggestion about addressing compiler warnings.
|
p.s. It would be nice if your commit comment mentioned "Port to Debian 12". |
|
Just saw your second commit. Is there a reason why you chose to make that rather complicated change to json5_parser/json5_parser_reader_template.h rather than the simpler one I suggested? |
85d2f10 to
22a8b1c
Compare
Guard String_type(begin, end) construction with an explicit begin >= end check so GCC can prove the range is non-negative.
| typename String_type::const_iterator end) { | ||
| typedef typename String_type::const_iterator Iter_type; | ||
|
|
||
| if (begin >= end) return String_type(); |
There was a problem hiding this comment.
The replaces the earlier complex change. This is a simpler change. Generated and summarized by AI
Guard String_type(begin, end) construction with an explicit
begin >= end check so GCC can prove the range is non-negative.
The earlier changes were ai-generated too, not sure why it was complex though.
sreenivasapydi
left a comment
There was a problem hiding this comment.
used a simple code change
|
I revised the commit and force pushed. please review now.
|
|
sorry for the multiple comments, I couldn't find this line : if (end - begin < 2) return String_type(begin, end); |
No description provided.