mirror of
https://github.com/google/sandboxed-api.git
synced 2024-03-22 13:11:30 +08:00
a613dda7f2
Check unwinding recursive calls. Verify we can unwind in absence of unwind tables. PiperOrigin-RevId: 513506498 Change-Id: Ib87240b7481dae3a4513c944e17a7924a54926e9
26 lines
603 B
C++
26 lines
603 B
C++
#include "sandboxed_api/sandbox2/testcases/symbolize_lib.h"
|
|
|
|
#include "absl/base/attributes.h"
|
|
|
|
ABSL_ATTRIBUTE_NOINLINE
|
|
ABSL_ATTRIBUTE_NO_TAIL_CALL
|
|
void LibRecurseA(void (*cb)(int), int data, int n);
|
|
|
|
ABSL_ATTRIBUTE_NOINLINE
|
|
ABSL_ATTRIBUTE_NO_TAIL_CALL
|
|
void LibRecurseB(void (*cb)(int), int data, int n) {
|
|
if (n > 1) {
|
|
return LibRecurseA(cb, data, n - 1);
|
|
}
|
|
return cb(data);
|
|
}
|
|
|
|
void LibRecurseA(void (*cb)(int), int data, int n) {
|
|
if (n > 1) {
|
|
return LibRecurseB(cb, data, n - 1);
|
|
}
|
|
return cb(data);
|
|
}
|
|
|
|
void LibRecurse(void (*cb)(int), int data, int n) { LibRecurseA(cb, data, n); }
|