Skip to content

Commit 17a5dd2

Browse files
egavrinruben-ayrapetyan
authored andcommitted
Add support of afl-fuzzer.
Related issue: #333, #454 Works only with default libc: ``` $ make debug.linux -j TOOLCHAIN="./build/configs/toolchain_afl.cmake" USE_COMPILER_DEFAULT_LIBC=YES ``` JerryScript-DCO-1.0-Signed-off-by: Ruben Ayrapetyan [email protected] JerryScript-DCO-1.0-Signed-off-by: Evgeny Gavrin [email protected]
1 parent e80cc35 commit 17a5dd2

File tree

3 files changed

+47
-1
lines changed

3 files changed

+47
-1
lines changed
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# Copyright 2015 Samsung Electronics Co., Ltd.
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
include(CMakeForceCompiler)
16+
17+
set(CMAKE_SYSTEM_NAME Linux)
18+
set(CMAKE_SYSTEM_PROCESSOR x86)
19+
20+
CMAKE_FORCE_C_COMPILER(afl-gcc GNU)
21+
CMAKE_FORCE_CXX_COMPILER(afl-g++ GNU)
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# Copyright 2015 Samsung Electronics Co., Ltd.
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
include(CMakeForceCompiler)
16+
17+
set(CMAKE_SYSTEM_NAME Linux)
18+
set(CMAKE_SYSTEM_PROCESSOR x86_64)
19+
20+
CMAKE_FORCE_C_COMPILER(afl-gcc GNU)
21+
CMAKE_FORCE_CXX_COMPILER(afl-g++ GNU)
22+
23+
set(FLAGS_COMMON_ARCH -ffixed-rbp)

jerry-core/jrt/jrt-fatals.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,9 @@ jerry_fatal (jerry_fatal_code_t code) /**< status code */
6060
}
6161
#endif /* !JERRY_NDEBUG */
6262

63-
if (code != 0 && jerry_is_abort_on_fail ())
63+
if (code != 0
64+
&& code != ERR_OUT_OF_MEMORY
65+
&& jerry_is_abort_on_fail ())
6466
{
6567
abort ();
6668
}

0 commit comments

Comments
 (0)