about summary refs log tree commit diff
path: root/src/rustllvm/RustWrapper.cpp
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2014-01-29 22:21:29 -0800
committerbors <bors@rust-lang.org>2014-01-29 22:21:29 -0800
commit056363ff362231c6e78543290bbc5c151b899f3d (patch)
treee98d7598b4bf62311246fb0b090e5d24e4aede3c /src/rustllvm/RustWrapper.cpp
parent3cb72a3655cdbe1db7a3555ade0c909d541bf336 (diff)
parent8d097b3bfb7af5c171f0177720e7388a294081e9 (diff)
downloadrust-056363ff362231c6e78543290bbc5c151b899f3d.tar.gz
rust-056363ff362231c6e78543290bbc5c151b899f3d.zip
auto merge of #11839 : typelist/rust/issue3008, r=huonw
It was possible to trigger a stack overflow in rustc because the routine used to verify enum representability,
type_structurally_contains, would recurse on inner types until hitting the original type. The overflow condition was when a different structurally recursive type (enum or struct) was contained in the type being checked.

I suspect my solution isn't as efficient as it could be. I pondered adding a cache of previously-seen types to avoid duplicating work (if enums A and B both contain type C, my code goes through C twice), but I didn't want to do anything that may not be necessary.

I'm a new contributor, so please pay particular attention to any unidiomatic code, misuse of terminology, bad naming of tests, or similar horribleness :)

Updated to verify struct representability as well.

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