-
Notifications
You must be signed in to change notification settings - Fork 13.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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)