rsmith added inline comments.

================
Comment at: lib/Basic/Stack.cpp:53-54
+  // If the stack pointer has a surprising value, we do not understand this
+  // stack usage scheme. (Perhaps the target allocates new stack regions on
+  // demand for us.) Don't try to guess what's going on.
+  if (StackUsage > DesiredStackSize)
----------------
rnk wrote:
> So, for example, ASan with UAR, where frames are heap allocated. I suppose in 
> that case we will go down the __builtin_frame_address path, though.
Can we detect that? It seems better to turn this all off if we think there's 
anything funny going on with the stack layout.


================
Comment at: test/SemaTemplate/stack-exhaustion.cpp:10
+template<typename ...T> struct tuple {};
+template<typename ...T> auto f(tuple<T...> t) -> decltype(f(tuple<T...>(t))) 
{} // expected-error {{exceeded maximum depth}}
+void g() { f(tuple<int, int>()); }
----------------
rnk wrote:
> This test seems like it could be fragile. If threads are disabled, it will 
> probably crash.
I've handled the "threads are disabled" case. Is there anything else that can 
meaningfully be detected here? (ASan maybe? Are there any other cases that lead 
to a non-linear stack layout that we can detect?)


Repository:
  rC Clang

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D66361/new/

https://reviews.llvm.org/D66361



_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to