[compiler-rt] fix missing include for `abort` in `FuzzedDataProvider.h` (PR #113872)

Takuto Ikuta via llvm-commits llvm-commits at lists.llvm.org
Mon Oct 28 04:54:36 PDT 2024


https://github.com/atetubou updated https://github.com/llvm/llvm-project/pull/113872

>From 506d2f5bfab0dc121a3d42ed7fc4e2840cec63ed Mon Sep 17 00:00:00 2001
From: Takuto Ikuta <tikuta at google.com>
Date: Mon, 28 Oct 2024 16:20:52 +0900
Subject: [PATCH 1/2] fix missing include for `FuzzedDataProvider.h`

This is for `abort` function.
---
 compiler-rt/include/fuzzer/FuzzedDataProvider.h | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/compiler-rt/include/fuzzer/FuzzedDataProvider.h b/compiler-rt/include/fuzzer/FuzzedDataProvider.h
index 5903ed837917ca..b9168868a8830f 100644
--- a/compiler-rt/include/fuzzer/FuzzedDataProvider.h
+++ b/compiler-rt/include/fuzzer/FuzzedDataProvider.h
@@ -13,6 +13,8 @@
 #ifndef LLVM_FUZZER_FUZZED_DATA_PROVIDER_H_
 #define LLVM_FUZZER_FUZZED_DATA_PROVIDER_H_
 
+#include <stdlib.h>
+
 #include <algorithm>
 #include <array>
 #include <climits>

>From 12806286aa176a5fee60f9e332cb80980d80cd0d Mon Sep 17 00:00:00 2001
From: Takuto Ikuta <tikuta at google.com>
Date: Mon, 28 Oct 2024 20:54:27 +0900
Subject: [PATCH 2/2] Update FuzzedDataProvider.h

Use cstdlib
---
 compiler-rt/include/fuzzer/FuzzedDataProvider.h | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/compiler-rt/include/fuzzer/FuzzedDataProvider.h b/compiler-rt/include/fuzzer/FuzzedDataProvider.h
index b9168868a8830f..e57b95b6304a9a 100644
--- a/compiler-rt/include/fuzzer/FuzzedDataProvider.h
+++ b/compiler-rt/include/fuzzer/FuzzedDataProvider.h
@@ -13,13 +13,12 @@
 #ifndef LLVM_FUZZER_FUZZED_DATA_PROVIDER_H_
 #define LLVM_FUZZER_FUZZED_DATA_PROVIDER_H_
 
-#include <stdlib.h>
-
 #include <algorithm>
 #include <array>
 #include <climits>
 #include <cstddef>
 #include <cstdint>
+#include <cstdlib>
 #include <cstring>
 #include <initializer_list>
 #include <limits>



More information about the llvm-commits mailing list