tests: Simplify VaList run-make test#56396
Conversation
The va_list tests were too complex and were causing some spurious test failures on Windows
|
r? @aturon (rust_highfive has picked a reviewer for you, use r? to override) |
|
It's not obvious to me why the previous implementation is triggering assertions. |
|
Okay, I get it now. Turns out that MSVC on x86-32 uses 4-byte stack alignment. Even though the alignment of the structure (in the sense of |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
| pub skip_ty: AnswerType, | ||
| unsafe fn compare_c_str(ptr: *const c_char, val: &str) -> bool { | ||
| let cstr0 = CStr::from_ptr(ptr); | ||
| let cstr1 = CString::new(val).unwrap(); |
There was a problem hiding this comment.
If this fails, this would panic across an FFI boundary, which is UB. Not expected to happen, but doing something more conservative (return false / abort) would be better.
There was a problem hiding this comment.
FWIW this'll soon become a deterministic abort (not UB), so this is probably fine to leave in
|
@bors: r=nikic p=10 (hopefully fixing spurious failures!) |
|
📌 Commit 28ca35f has been approved by |
tests: Simplify VaList run-make test The va_list tests were too complex and were causing some spurious test failures on Windows. Example: #55011 (comment)
Exactly. Didn't compile locally with debug_assertions or think of this when I first wrote the test. |
|
☀️ Test successful - status-appveyor, status-travis |
The va_list tests were too complex and were causing some spurious
test failures on Windows.
Example: #55011 (comment)