From 948e1e19ce765eab4c2d4cc603b7e4cfdce12504 Mon Sep 17 00:00:00 2001 From: Markus Westerlind Date: Tue, 12 Jan 2021 11:17:27 +0100 Subject: [PATCH] Fix check_recursion_prefix --- src/de.rs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/de.rs b/src/de.rs index f08e28f85..63cca7b0d 100644 --- a/src/de.rs +++ b/src/de.rs @@ -180,9 +180,11 @@ macro_rules! if_checking_recursion_limit { macro_rules! check_recursion_prefix { ($self_: ident, $error: path) => { - $self_.remaining_depth -= 1; - if $self_.remaining_depth == 0 { - return $error($self_.error(ErrorCode::RecursionLimitExceeded)); + if_checking_recursion_limit! { + $self_.remaining_depth -= 1; + if $self_.remaining_depth == 0 { + return $error($self_.error(ErrorCode::RecursionLimitExceeded)); + } } }; }