lib/brakeman/processors/alias_processor.rb in brakeman-3.1.2 vs lib/brakeman/processors/alias_processor.rb in brakeman-3.1.3
- old
+ new
@@ -60,19 +60,24 @@
end
rescue => err
@tracker.error err if @tracker
end
- #Generic replace
- if replacement = env[exp] and not duplicate? replacement
- result = replacement.deep_clone(exp.line)
- else
- result = exp
- end
-
+ result = replace(exp)
+
@exp_context.pop
result
+ end
+
+ def replace exp, int = 0
+ return exp if int > 3
+
+ if replacement = env[exp] and not duplicate? replacement
+ replace(replacement.deep_clone(exp.line), int + 1)
+ else
+ exp
+ end
end
ARRAY_CONST = s(:const, :Array)
HASH_CONST = s(:const, :Hash)