albertZhangTJ / sqlancer-lancerfuzz

Detecting Logic Bugs in DBMS
http://www.sqlancer.com/
MIT License
1 stars 0 forks source link

ANTLR parser bug #36

Open albertZhangTJ opened 1 month ago

albertZhangTJ commented 1 month ago

The following grammar file segment, specifically the Java single-line comment as part of ANTLR action, will lead to an mis-parsing.

rule : content {//comment} ;
albertZhangTJ commented 1 month ago

With some testing, can currently confirm that the issue will only be triggered if

rule : content {//comment};

but not if

rule : content {
    //comment
};

In other words, the ANTLR parser will treat the // as an ANTLR-level comment pattern instead of a Java level one. Not sure if this should be an expected behavior or not. Probably gonna leave this for later.