about summary refs log tree commit diff
path: root/src/rustllvm/RustWrapper.cpp
diff options
context:
space:
mode:
authorAaron Hill <aa1ronham@gmail.com>2018-12-11 14:18:30 -0500
committerAaron Hill <aa1ronham@gmail.com>2019-01-03 21:56:52 -0500
commit6d54672acf431ceae0b057f45e0351e84793d9f2 (patch)
treeb8e88777d89f62761df51f0a032cc44c9d7b68d0 /src/rustllvm/RustWrapper.cpp
parentc0bbc3927e28c22edefe6a1353b5ecc95ea9a104 (diff)
downloadrust-6d54672acf431ceae0b057f45e0351e84793d9f2.tar.gz
rust-6d54672acf431ceae0b057f45e0351e84793d9f2.zip
Fix stack overflow when finding blanket impls
Currently, SelectionContext tries to prevent stack overflow by keeping
track of the current recursion depth. However, this depth tracking is
only used when performing normal section (which includes confirmation).
No such tracking is performed for evaluate_obligation_recursively, which
can allow a stack overflow to occur.

To fix this, this commit tracks the current predicate evaluation depth.
This is done separately from the existing obligation depth tracking:
an obligation overflow can occur across multiple calls to 'select' (e.g.
when fulfilling a trait), while a predicate evaluation overflow can only
happen as a result of a deep recursive call stack.

Fixes #56701
Diffstat (limited to 'src/rustllvm/RustWrapper.cpp')
0 files changed, 0 insertions, 0 deletions