You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Mar 8, 2020. It is now read-only.
It's the CDT's issue. It cannot handle ambiguities for ellipsis (...)in parameter declaration.
For instance following function (LocOffsetEnd: 19, LocOffsetStart: 0):
voidfoo(int&...);
takes various number of int references. In CDT ... notation is called ellipsis. A parser parses all tokens correctly but at the end it visits CPPASTAmbiguityResolver, which tries to resolve ambiguity, what calls CPPASTAmbiguousParameterDeclaration.doResolveAmbiguity.
This class is responsible for:
Handles ambiguities for ellipsis in parameter declaration.
template<typename... T> void function(T ...); // is T a parameter pack?
and it tries to adjustOffsets(dtor).
Unfortunately the function does not work well if we have any parameters next to the type (&, *).
Here is a snippet from adjustOffsets function:
We have only one param &, so the first and last point to the same node with offset 12 and length 1.
In my opinion the function setOffsetAndLength (which overwrites position) is called incorrectly, because the second parameter value (last.getOffset() + last.getLength()) points to the end offset, but the function signature is:
voidsetOffsetAndLength(intoffset, intlength)
so, now if we try to calculate the end offset it will be offset + length.
In our case original offset was 12, length 1, but after adjust the length was 12 + 1 = 13, so the end offset is 25, what in our case it goes out of bounds [0, 19]
From bblfsh logs we got a message of
offset out of bounds
.Example of files that triggered this error:
The text was updated successfully, but these errors were encountered: