mirror of
https://github.com/apache/datafusion-sqlparser-rs.git
synced 2025-09-04 21:20:32 +00:00
fix: Fix stack overflow in parse_subexpr (#1410)
This commit is contained in:
parent
aa714e3447
commit
4875dadbf5
2 changed files with 8 additions and 1 deletions
|
@ -897,12 +897,12 @@ impl<'a> Parser<'a> {
|
|||
|
||||
/// Parse a new expression.
|
||||
pub fn parse_expr(&mut self) -> Result<Expr, ParserError> {
|
||||
let _guard = self.recursion_counter.try_decrease()?;
|
||||
self.parse_subexpr(self.dialect.prec_unknown())
|
||||
}
|
||||
|
||||
/// Parse tokens until the precedence changes.
|
||||
pub fn parse_subexpr(&mut self, precedence: u8) -> Result<Expr, ParserError> {
|
||||
let _guard = self.recursion_counter.try_decrease()?;
|
||||
debug!("parsing expr");
|
||||
let mut expr = self.parse_prefix()?;
|
||||
debug!("prefix: {:?}", expr);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue