Skip to content

Commit

Permalink
Merge pull request #141 from VectorCamp/bugfix/hs-flag-utf8-signed-ch…
Browse files Browse the repository at this point in the history
…ar-on-arm

Set Ragel.rl char type to unsigned, #135
  • Loading branch information
markos authored Mar 23, 2023
2 parents 0f967b9 + 842e680 commit e6b97a9
Show file tree
Hide file tree
Showing 9 changed files with 13 additions and 6 deletions.
5 changes: 3 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -544,7 +544,6 @@ endif()
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${ARCH_C_FLAGS}")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${ARCH_CXX_FLAGS}")

add_subdirectory(util)
add_subdirectory(doc/dev-reference)

# PCRE check, we have a fixed requirement for PCRE to use Chimera
Expand Down Expand Up @@ -588,7 +587,7 @@ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_C_FLAGS}")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${EXTRA_CXX_FLAGS}")
endif()

set(RAGEL_C_FLAGS "-Wno-unused")
set(RAGEL_C_FLAGS "-Wno-unused -funsigned-char")

set_source_files_properties(
${CMAKE_BINARY_DIR}/src/parser/Parser.cpp
Expand All @@ -604,6 +603,8 @@ set_source_files_properties(

ragelmaker(src/parser/control_verbs.rl)

add_subdirectory(util)

SET(hs_HEADERS
src/hs.h
src/hs_common.h
Expand Down
2 changes: 1 addition & 1 deletion cmake/ragel.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ function(ragelmaker src_rl)
add_custom_command(
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${src_dir}/${src_file}.cpp
COMMAND ${CMAKE_COMMAND} -E make_directory ${CMAKE_CURRENT_BINARY_DIR}/${src_dir}
COMMAND ${RAGEL} ${CMAKE_CURRENT_SOURCE_DIR}/${src_rl} -o ${rl_out}
COMMAND ${RAGEL} ${CMAKE_CURRENT_SOURCE_DIR}/${src_rl} -o ${rl_out} -G0
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${src_rl}
)
add_custom_target(ragel_${src_file} DEPENDS ${rl_out})
Expand Down
2 changes: 1 addition & 1 deletion src/fdr/teddy_runtime_common.h
Original file line number Diff line number Diff line change
Expand Up @@ -348,7 +348,7 @@ static really_inline
m512 vectoredLoad512(m512 *p_mask, const u8 *ptr, const size_t start_offset,
const u8 *lo, const u8 *hi, const u8 *hbuf, size_t hlen,
const u32 nMasks) {
m512 val;
m512 val = zeroes512();

uintptr_t copy_start;
uintptr_t copy_len;
Expand Down
2 changes: 1 addition & 1 deletion src/hs.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@

#define HS_MAJOR 5
#define HS_MINOR 4
#define HS_PATCH 0
#define HS_PATCH 9

#include "hs_compile.h"
#include "hs_runtime.h"
Expand Down
1 change: 1 addition & 0 deletions src/parser/Parser.rl
Original file line number Diff line number Diff line change
Expand Up @@ -272,6 +272,7 @@ unichar readUtf8CodePoint4c(const char *s) {

%%{
machine regex;
alphtype unsigned char;

action throwUnsupportedEscape {
ostringstream str;
Expand Down
1 change: 1 addition & 0 deletions src/parser/control_verbs.rl
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ const char *read_control_verbs(const char *ptr, const char *end, size_t start,

%%{
machine ControlVerbs;
alphtype unsigned char;

# Verbs that we recognise but do not support.
unhandledVerbs = '(*' (
Expand Down
1 change: 1 addition & 0 deletions tools/hscollider/ColliderCorporaParser.rl
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ char unhex(const char *start, UNUSED const char *end) {

%%{
machine FileCorporaParser;
alphtype unsigned char;

action accumulateNum {
num = (num * 10) + (fc - '0');
Expand Down
4 changes: 3 additions & 1 deletion util/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,10 @@ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${EXTRA_CXX_FLAGS} ${HS_CXX_FLAGS}")
include_directories(${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR}
${PROJECT_SOURCE_DIR})

message("RAGEL_C_FLAGS" ${RAGEL_C_FLAGS})

set_source_files_properties(
${CMAKE_BINARY_DIR}/tools/ExpressionParser.cpp
${CMAKE_BINARY_DIR}/util/ExpressionParser.cpp
PROPERTIES
COMPILE_FLAGS "${RAGEL_C_FLAGS}")

Expand Down
1 change: 1 addition & 0 deletions util/ExpressionParser.rl
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ enum ParamKey {

%%{
machine ExpressionParser;
alphtype unsigned char;

action accumulateNum {
num = (num * 10) + (fc - '0');
Expand Down

0 comments on commit e6b97a9

Please sign in to comment.