Skip to content

Commit 04a207e

Browse files
Auto merge of #142300 - jieyouxu:exp-partial-revert-141576, r=<try>
[EXPERIMENTAL] Revert `mte-ffi` changes See #141600. try-job: aarch64-gnu
2 parents 100199c + e22aa15 commit 04a207e

File tree

4 files changed

+4
-7
lines changed

4 files changed

+4
-7
lines changed

tests/run-make/mte-ffi/bar.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
// FIXME(#141600) the mte-ffi test doesn't fail in aarch64-gnu
2-
31
#ifndef __BAR_H
42
#define __BAR_H
53

tests/run-make/mte-ffi/bar_float.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
#include <stdint.h>
44
#include "bar.h"
55

6-
extern void foo(float*);
6+
extern void foo(char*);
77

8-
void bar(float *ptr) {
8+
void bar(char *ptr) {
99
if (((uintptr_t)ptr >> 56) != 0x1f) {
1010
fprintf(stderr, "Top byte corrupted on Rust -> C FFI boundary!\n");
1111
exit(1);

tests/run-make/mte-ffi/bar_int.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
extern void foo(unsigned int *);
77

8-
void bar(unsigned int *ptr) {
8+
void bar(char *ptr) {
99
if (((uintptr_t)ptr >> 56) != 0x1f) {
1010
fprintf(stderr, "Top byte corrupted on Rust -> C FFI boundary!\n");
1111
exit(1);

tests/run-make/mte-ffi/bar_string.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
#include <stdio.h>
22
#include <stdlib.h>
33
#include <stdint.h>
4-
#include <string.h>
54
#include "bar.h"
65

76
extern void foo(char*);
@@ -33,7 +32,7 @@ int main(void)
3332

3433
// Store an arbitrary tag in bits 56-59 of the pointer (where an MTE tag may be),
3534
// and a different value in the ignored top 4 bits.
36-
ptr = (char *)((uintptr_t)ptr | 0x1fl << 56);
35+
ptr = (unsigned int *)((uintptr_t)ptr | 0x1fl << 56);
3736

3837
if (mte_enabled()) {
3938
set_tag(ptr);

0 commit comments

Comments
 (0)