Skip to content

Commit e0c1459

Browse files
authored
Merge pull request #207 from Kray-G/develop
Regularly merge to the master.
2 parents 9d536dc + b50dbd1 commit e0c1459

File tree

130 files changed

+39294
-24373
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

130 files changed

+39294
-24373
lines changed

build/Makefile

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -186,8 +186,8 @@ install:
186186
cp -f kxssh.so /usr/bin/kinxlib/
187187
cp -f kxjit.so /usr/bin/kinxlib/
188188
cp -f kxprocess.so /usr/bin/kinxlib/
189-
cp -f libonig.so.5.0.0 /usr/bin/kinxlib/
190-
ln -sf /usr/bin/kinxlib/libonig.so.5.0.0 /usr/bin/kinxlib/libonig.so.5
189+
cp -f libonig.so.5.1.0 /usr/bin/kinxlib/
190+
ln -sf /usr/bin/kinxlib/libonig.so.5.1.0 /usr/bin/kinxlib/libonig.so.5
191191
ln -sf /usr/bin/kinxlib/libonig.so.5 /usr/bin/kinxlib/libonig.so
192192
cp -f libz.so.1.2.11 /usr/bin/kinxlib/
193193
cp -f libssl.so.3 /usr/bin/kinxlib/
@@ -309,8 +309,8 @@ libonig.so:
309309
autoreconf -vfi; \
310310
./configure --with-pic; \
311311
make; \
312-
cp -f src/.libs/libonig.so.5.0.0 $(CDIR);
313-
ln -s libonig.so.5.0.0 libonig.so.5; \
312+
cp -f src/.libs/libonig.so.5.1.0 $(CDIR);
313+
ln -s libonig.so.5.1.0 libonig.so.5; \
314314
ln -s libonig.so.5 libonig.so;
315315

316316
$(SRCDIR)/extlib/kc-json/dist/kc-json.h:

build/Makefile.msc

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -228,8 +228,12 @@ kxdouble.dll: $(SRCDIR)/extlib/kxdouble.c $(PICOBJS)
228228
kxarray.dll: $(SRCDIR)/extlib/kxarray.c $(PICOBJS)
229229
$(CC) /LD $(CFLAGS) /Fe$@ $(SRCDIR)/extlib/kxarray.c $(PICOBJS)
230230

231-
kxfile.dll: $(SRCDIR)/extlib/kxfile.c $(PICOBJS) $(SRCDIR)/extlib/ansicolor/ansicolor_w32.obj $(SRCDIR)/extlib/zip/x64/vs2017/minizip.lib $(SRCDIR)/extlib/zip/x64/vs2017/zlib.lib
232-
$(CC) /LD $(CFLAGS) /Fe$@ $(SRCDIR)/extlib/kxfile.c $(PICOBJS) $(SRCDIR)/extlib/ansicolor/ansicolor_w32.obj $(SRCDIR)/extlib/zip/x64/vs2017/minizip.lib $(SRCDIR)/extlib/zip/x64/vs2017/zlib.lib user32.lib advapi32.lib
231+
kxfile.dll: $(SRCDIR)/extlib/kxfile.c $(PICOBJS) $(SRCDIR)/extlib/ansicolor/ansicolor_w32.obj $(SRCDIR)/extlib/zip/x64/vs2017/minizip.lib $(SRCDIR)/extlib/zip/x64/vs2017/zlib.lib $(SRCDIR)/extlib/zip/x64/vs2017/bzip2.lib
232+
$(CC) /LD $(CFLAGS) /Fe$@ $(SRCDIR)/extlib/kxfile.c $(PICOBJS) $(SRCDIR)/extlib/ansicolor/ansicolor_w32.obj \
233+
$(SRCDIR)/extlib/zip/x64/vs2017/minizip.lib \
234+
$(SRCDIR)/extlib/zip/x64/vs2017/zlib.lib \
235+
$(SRCDIR)/extlib/zip/x64/vs2017/bzip2.lib \
236+
user32.lib advapi32.lib crypt32.lib
233237

234238
kxdebugger.dll: $(SRCDIR)/extlib/kxdebugger.c $(PICOBJS) $(SRCDIR)/extlib/ansicolor/ansicolor_w32.obj
235239
$(CC) /LD $(CFLAGS) /Fe$@ $(SRCDIR)/extlib/kxdebugger.c $(PICOBJS) $(SRCDIR)/extlib/ansicolor/ansicolor_w32.obj user32.lib advapi32.lib
@@ -289,6 +293,9 @@ $(SRCDIR)/extlib/zip/x64/vs2017/zlib.dll:
289293
$(SRCDIR)/extlib/zip/x64/vs2017/zlib.lib:
290294
echo Build minizip.lib first.
291295

296+
$(SRCDIR)/extlib/zip/x64/vs2017/bzip2.lib:
297+
echo Build minizip.lib first.
298+
292299
$(SRCDIR)/extlib/kc-json/dist/kc-json.obj:
293300
pushd $(SRCDIR)\extlib\kc-json && nmake -f Makefile.msc all && popd
294301

docs/QuickReference.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1020,12 +1020,12 @@ var x = new A.B.X(); // OK
10201020
Here is the expression's priority order.
10211021
The order of upside of the list is higher.
10221022

1023-
| # | Type | Excample | Evaluation |
1023+
| No. | Type | Excample | Evaluation |
10241024
| :---: | ------------- | ------------------------------------------------------------------------------------------------------------- | :-----------: |
1025-
| 1 | Factor | Variable, Number, String, ... | |
1025+
| 1 | Factor | Variable, Number, String, ... | - |
10261026
| 2 | Postfix | `++`, `--`, `[]`, `.`, `()` | left to right |
1027-
| 3 | Prefix | `!`, `+`, `-`, `++`, `--` | left to right |
1028-
| 4 | Matching | `=~`, `!~` | left to right |
1027+
| 3 | Prefix | `!`, `+`, `-`, `*`, `++`, `--` | left to right |
1028+
| 4 | Match/Range | `=~`, `!~`, `n..m` | left to right |
10291029
| 5 | Exponent | `**` | right to left |
10301030
| 6 | Mul,... | `*`, `/`, `%` | left to right |
10311031
| 7 | Add,... | `+`, `-` | left to right |

examples/http.kx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
import Net;
2-
31
var http = new Net.Http();
42

53
# http.setDebugDetail(true, { hex: false });

lib/std/kxstartup.kx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
const STDIN, STDOUT, STDERR, $exepath, $kinxpath, $libpath;
1+
const STDIN, STDOUT, STDERR, $exepath, $kinxpath, $libpath, $pkgpath;
22
const System, Signal, String, Binary, Array, Integer, Double, Math, Regex, File, Directory, Clib, Iconv, Duktape, Debugger;
33
const Isolate, Enumerable, Enumerator, Range;
44
const SQLite, Database, Zip, JSON, SystemTimer, Fiber;
@@ -75,6 +75,7 @@ var Xml, Net;
7575
}
7676
}
7777
$libpath = libpath;
78+
$pkgpath = ($libpath / "../kinxpkg").replace(/\/[^\/]+\/\.\./, "");
7879
})();
7980

8081
const KX_KEY_ESC = 0x1b;

lib/std/net/http.kx

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,16 @@ _namespace Net {
5151
}
5252

5353
public setProxy(url) {
54-
curl_.setOptionInt(Net.CURLOPT_PROXY, url);
54+
curl_.setOptionString(Net.CURLOPT_PROXY, url);
55+
return this;
56+
}
57+
58+
public setProxyPort(port) {
59+
if (port.isInteger) {
60+
curl_.setOptionString(Net.CURLOPT_PROXYPORT, ""+port);
61+
} else {
62+
curl_.setOptionString(Net.CURLOPT_PROXYPORT, port);
63+
}
5564
return this;
5665
}
5766

src/extlib/onig/.gitignore

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,13 @@ m4/*.m4
4444

4545
# test/
4646
/test/test_utf8
47+
/test/test_options
4748
/test/testc
4849
/test/testcu
4950
/test/testp
5051
/test/test_regset
52+
/test/test_syntax
53+
/test/test_back
5154
/test/kofu-utf8.txt
5255

5356
# sample/
@@ -65,11 +68,12 @@ m4/*.m4
6568
/sample/count
6669
/sample/bug_fix
6770
/sample/regset
71+
/sample/scan
6872
/sample/log*
6973

7074
/harnesses/utf16*.dict
71-
/harnesses/*-libfuzzer
72-
/harnesses/main-*
75+
/harnesses/fuzzer-*
76+
/harnesses/read-*
7377
/harnesses/libfuzzer-onig
7478
/harnesses/libfuzzer-onig-full
7579
/harnesses/slow-unit-*

src/extlib/onig/CMakeLists.txt

Lines changed: 30 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
cmake_minimum_required(VERSION 3.1)
22
project(oniguruma
3-
VERSION 6.9.4
3+
VERSION 6.9.6
44
LANGUAGES C)
55

66
set(PACKAGE onig)
77
set(PACKAGE_VERSION ${PROJECT_VERSION})
88

99
option(BUILD_SHARED_LIBS "Build shared libraries" ON)
10-
option(ENABLE_POSIX_API "Include POSIX API" ON)
10+
option(ENABLE_POSIX_API "Include POSIX API" OFF)
11+
option(ENABLE_BINARY_COMPATIBLE_POSIX_API "Include Binary compatible POSIX API" OFF)
1112
if(MSVC)
1213
option(MSVC_STATIC_RUNTIME "Build with static runtime" OFF)
1314
endif()
@@ -32,6 +33,8 @@ check_include_files(unistd.h HAVE_UNISTD_H)
3233
check_include_files(inttypes.h HAVE_INTTYPES_H)
3334
check_type_size(int SIZEOF_INT)
3435
check_type_size(long SIZEOF_LONG)
36+
check_type_size("long long" SIZEOF_LONG_LONG)
37+
check_type_size("void*" SIZEOF_VOIDP)
3538

3639
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/src/config.h.cmake.in ${CMAKE_CURRENT_BINARY_DIR}/config.h)
3740

@@ -54,9 +57,14 @@ set(_SRCS src/regint.h src/regparse.h src/regenc.h src/st.h
5457

5558
set(_INST_HEADERS src/oniguruma.h src/oniggnu.h)
5659

57-
if(ENABLE_POSIX_API)
60+
if(ENABLE_POSIX_API OR ENABLE_BINARY_COMPATIBLE_POSIX_API)
5861
set(_SRCS ${_SRCS} src/regposix.c src/regposerr.c)
5962
set(_INST_HEADERS ${_INST_HEADERS} src/onigposix.h)
63+
add_definitions("-DUSE_POSIX_API")
64+
endif()
65+
66+
if(ENABLE_BINARY_COMPATIBLE_POSIX_API)
67+
add_definitions("-DUSE_BINARY_COMPATIBLE_POSIX_API")
6068
endif()
6169

6270
add_library(onig ${_SRCS})
@@ -67,6 +75,19 @@ target_include_directories(onig PUBLIC
6775
target_compile_definitions(onig PUBLIC
6876
$<$<NOT:$<BOOL:${BUILD_SHARED_LIBS}>>:ONIG_STATIC>)
6977

78+
if(BUILD_SHARED_LIBS)
79+
# Parse SOVERSION information from LTVERSION in configure.ac
80+
file(STRINGS "${CMAKE_CURRENT_SOURCE_DIR}/configure.ac" LTVERSION REGEX "^LTVERSION *= *\"?[0-9]+:[0-9]+:[0-9]+\"?")
81+
string(REGEX REPLACE "^LTVERSION *= *\"?([0-9]+:[0-9]+:[0-9]+)\"?.*$" "\\1" LTVERSION "${LTVERSION}")
82+
string(REGEX REPLACE "^([0-9]+):([0-9]+):([0-9]+)" "\\1" LTCURRENT ${LTVERSION})
83+
string(REGEX REPLACE "^([0-9]+):([0-9]+):([0-9]+)" "\\2" LTREVISION ${LTVERSION})
84+
string(REGEX REPLACE "^([0-9]+):([0-9]+):([0-9]+)" "\\3" LTAGE ${LTVERSION})
85+
math(EXPR ONIG_SOVERSION "${LTCURRENT} - ${LTAGE}")
86+
set_target_properties(onig PROPERTIES
87+
SOVERSION "${ONIG_SOVERSION}"
88+
VERSION "${ONIG_SOVERSION}.${LTAGE}.${LTREVISION}")
89+
endif()
90+
7091
if(MSVC)
7192
target_compile_options(onig PRIVATE
7293
#/W4
@@ -79,6 +100,12 @@ if(MSVC)
79100
$<$<CONFIG:RelWithDebgInfo>:/MTd>
80101
)
81102
endif()
103+
if(MSVC_VERSION LESS_EQUAL "1600")
104+
# <= VS2010
105+
target_compile_definitions(onig PRIVATE
106+
-Dinline=__inline
107+
)
108+
endif()
82109
elseif(CMAKE_COMPILER_IS_GNUCC)
83110
target_compile_options(onig PRIVATE
84111
-Wall

src/extlib/onig/COPYING

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Oniguruma LICENSE
22
-----------------
33

4-
Copyright (c) 2002-2019 K.Kosako <kkosako0@gmail.com>
4+
Copyright (c) 2002-2021 K.Kosako <kkosako0@gmail.com>
55
All rights reserved.
66

77
Redistribution and use in source and binary forms, with or without

src/extlib/onig/HISTORY

Lines changed: 77 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,85 @@
11
History
22

3+
2020/11/05: Version 6.9.6
4+
5+
2020/11/01: fix Issue 26798 in oss-fuzz: Timeout
6+
2020/10/27: fix Issue 26675 in oss-fuzz: Timeout
7+
8+
2020/10/21: Release Candidate 4 for Version 6.9.6
9+
10+
2020/10/20: #221: revert cbe9f8b and 8155473: Out-of-bounds write in #207 (Issues found with Coverity) is fake
11+
12+
2020/10/16: Release Candidate 3 for Version 6.9.6
13+
14+
2020/10/15: fix #220: autotools not building DLL using msys2 and mingw64 on windows 10
15+
2020/10/12: fix #219: Binary incompatibilty between 6.9.5_rev1 -> 6.9.2_rc2: reg_number_of_names
16+
17+
2020/10/09: Release Candidate 2 for Version 6.9.6
18+
19+
2020/10/09: fix #216: build fails on Windows
20+
21+
2020/10/07: Release Candidate 1 for Version 6.9.6
22+
23+
2020/09/30: add configure option --enable-binary-compatible-posix-api
24+
2020/09/24: fix: Issue 25893 in oss-fuzz: Stack-buffer-overflow
25+
2020/09/22: fix Issues found with Coverity (Issue #207)
26+
2020/08/27: fix Issue #204: define uint32_t and uint64_t for Visual Studio older than 2010
27+
2020/08/04: fix Issue 24544 in oss-fuzz: Timeout
28+
2020/07/21: add USE_CHECK_VALIDITY_OF_STRING_IN_TREE (fix Issue 24276 in oss-fuzz: Undefined-shift)
29+
2020/07/20: fix: Issue 24268 in oss-fuzz: Timeout
30+
2020/07/17: fix: Issue 24112 in oss-fuzz: Undefined-shift
31+
2020/07/14: fix: Issue 24066 in oss-fuzz: Timeout
32+
2020/07/05: fix: Incomplete application of ONIG_OPTION_NOTBOL to \A
33+
2020/07/05: fix: Incomplete application of ONIG_OPTION_NOT_END_STRING to \Z (Issue #192)
34+
2020/07/05: fix: Incomplete application of ONIG_OPTION_NOTEOL to \z
35+
2020/07/05: fix: Incomplete application of ONIG_OPTION_NOTEOL to \Z
36+
2020/07/01: add ONIG_OPTION_NOT_END_STRING (Issue #198)
37+
2020/06/28: add ONIG_OPTION_NOT_BEGIN_POSITION (Issue #198)
38+
2020/06/28: add ONIG_OPTION_NOT_BEGIN_STRING
39+
2020/06/28: fix: Issue 23754 in oss-fuzz: Timeout
40+
2020/06/21: fix: Issue 23525 in oss-fuzz: Timeout
41+
2020/06/15: fix: Issue 23311 in oss-fuzz: Timeout
42+
2020/06/03: fix: Issue 22925 in oss-fuzz: Index-out-of-bounds
43+
2020/06/03: fix: Issue 22917 in oss-fuzz: Out-of-memory
44+
2020/06/02: fix: Issue 22916 in oss-fuzz: Timeout
45+
2020/05/29: fix: Issue 22744 in oss-fuzz: Integer-overflow
46+
2020/05/28: fix: Issue 22658 in oss-fuzz: check backref with level
47+
2020/05/28: fix: Issue 22533 in oss-fuzz: memory leak
48+
2020/05/23: fix: Issue 22393 in oss-fuzz: Integer-overflow
49+
2020/05/13: fix: Issue 22154 in oss-fuzz: When the option FIND_LONGEST is specified, match_at() returns ONIG_MISMATCH unless there is no need to search any more.
50+
2020/05/06: Add SOVERSION info to library when using cmake
51+
2020/05/04: fix: 22008 in oss-fuzz
52+
2020/05/04: fix: 21998 in oss-fuzz
53+
2020/05/03: fix: 21944, 21977 in oss-fuzz
54+
55+
2020/04/26: Version 6.9.5 revised 1
56+
57+
2020/04/24: fix #192: Unexpected regex match
58+
59+
2020/04/20: Version 6.9.5
60+
61+
2020/04/12: Release Candidate 2 for Version 6.9.5
62+
2020/04/09: fix a problem (found by oss-fuzz test on my PC)
63+
2020/04/05: Release Candidate 1 for Version 6.9.5
64+
2020/03/30: remove src/*.py and src/*.sh from distribution files
65+
2020/03/27: NEW: Code point sequence notation \x{HHHH ...}, \o{OOOO ...}
66+
2020/03/24: NEW API: maximum nesting level of subexp call
67+
2020/03/22: #165: change enable-posix-api default from YES to NO
68+
2020/03/15: update Unicode version to 13.0.0
69+
2020/03/10: add test_back.c
70+
2020/03/08: tune output of debug in print_optimize_info()
71+
2020/03/02: fix #186: Allow regset search to succeed at end of string
72+
2020/02/13: NEW API: retry-limit-in-search functions
73+
2020/01/20: add ONIG_SYN_VARIABLE_LEN_LOOK_BEHIND flag
74+
2019/12/27: add USE_REGSET switch
75+
2019/12/20: remove OPTIMIZE_STR_CASE_FOLD
76+
2019/12/13: add test/test_syntax.c
77+
2019/12/13: add ONIG_SYN_ISOLATED_OPTION_CONTINUE_BRANCH flag
78+
79+
380
2019/11/29: Version 6.9.4
481

582
2019/11/22: Release Candidate 3 for Version 6.9.4
6-
783
2019/11/20: fix a problem found by libFuzzer test
884
2019/11/14: Release Candidate 2 for Version 6.9.4
985
2019/11/12: fix integer overflow by nested quantifier

0 commit comments

Comments
 (0)