Skip to content

Commit 41f5e70

Browse files
committed
Fix signed integer overflow
1 parent e6024f3 commit 41f5e70

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

.github/workflows/release.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,8 @@ jobs:
104104

105105
- name: Run tests
106106
run: |
107-
./test.sh --release --clean --release-sysroot --build-sysroot --mini-tests --std-tests # --test-libcore # FIXME(antoyo): libcore tests fail.
107+
./test.sh --release --clean --release-sysroot --build-sysroot --mini-tests --std-tests --test-libcore
108+
# TODO(antoyo): also run the rustc's test suite.
108109
109110
- name: Run stdarch tests
110111
run: |

src/base.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,8 @@ pub fn compile_codegen_unit<'tcx>(tcx: TyCtxt<'tcx>, cgu_name: Symbol, supports_
124124
context.add_command_line_option("-fno-semantic-interposition");
125125
// NOTE: Rust relies on LLVM not doing TBAA (https://github.com/rust-lang/unsafe-code-guidelines/issues/292).
126126
context.add_command_line_option("-fno-strict-aliasing");
127+
// NOTE: Rust relies on LLVM doing wrapping on overflow.
128+
context.add_command_line_option("-fwrapv");
127129

128130
if tcx.sess.opts.unstable_opts.function_sections.unwrap_or(tcx.sess.target.function_sections) {
129131
context.add_command_line_option("-ffunction-sections");

0 commit comments

Comments
 (0)