aboutsummaryrefslogtreecommitdiffstats
path: root/erts
diff options
context:
space:
mode:
Diffstat (limited to 'erts')
-rw-r--r--erts/emulator/beam/erl_init.c8
-rw-r--r--erts/emulator/beam/ops.tab2
-rw-r--r--erts/emulator/pcre/pcre_compile.c9
-rw-r--r--erts/emulator/pcre/pcre_exec.c1
-rw-r--r--erts/emulator/test/beam_SUITE.erl35
-rw-r--r--erts/epmd/src/epmd_int.h12
6 files changed, 46 insertions, 21 deletions
diff --git a/erts/emulator/beam/erl_init.c b/erts/emulator/beam/erl_init.c
index e97ab328cd..41cfcd74aa 100644
--- a/erts/emulator/beam/erl_init.c
+++ b/erts/emulator/beam/erl_init.c
@@ -819,7 +819,13 @@ erl_start(int argc, char **argv)
if (erts_sys_getenv("ERL_THREAD_POOL_SIZE", envbuf, &envbufsz) == 0) {
async_max_threads = atoi(envbuf);
}
-
+
+#if (defined(__APPLE__) && defined(__MACH__)) || defined(__DARWIN__)
+ /*
+ * The default stack size on MacOS X is too small for pcre.
+ */
+ erts_sched_thread_suggested_stack_size = 256;
+#endif
#ifdef DEBUG
verbose = DEBUG_DEFAULT;
diff --git a/erts/emulator/beam/ops.tab b/erts/emulator/beam/ops.tab
index 231ea34fd5..9e8ac74f40 100644
--- a/erts/emulator/beam/ops.tab
+++ b/erts/emulator/beam/ops.tab
@@ -1304,7 +1304,7 @@ fmul p FR1 FR2 FR3 => i_fmul FR1 FR2 FR3
fdiv p FR1 FR2 FR3 => i_fdiv FR1 FR2 FR3
fnegate p FR1 FR2 => i_fnegate FR1 FR2
-fconv Int=iq Dst=l => move Int x | fconv x Dst
+fconv Arg=iqan Dst=l => move Arg x | fconv x Dst
fmove q l
fmove d l
diff --git a/erts/emulator/pcre/pcre_compile.c b/erts/emulator/pcre/pcre_compile.c
index 29743362d4..9508c5a697 100644
--- a/erts/emulator/pcre/pcre_compile.c
+++ b/erts/emulator/pcre/pcre_compile.c
@@ -92,6 +92,11 @@ is 4 there is plenty of room. */
#define COMPILE_WORK_SIZE (4096)
+/* The overrun tests check for a slightly smaller size so that they detect the
+overrun before it actually does run off the end of the data block. */
+
+#define WORK_SIZE_CHECK (COMPILE_WORK_SIZE - 100)
+
/* Table for handling escaped characters in the range '0'-'z'. Positive returns
are simple data values; negative values are for special things like \d and so
@@ -2445,7 +2450,7 @@ for (;; ptr++)
#ifdef DEBUG
if (code > cd->hwm) cd->hwm = code; /* High water info */
#endif
- if (code > cd->start_workspace + COMPILE_WORK_SIZE) /* Check for overrun */
+ if (code > cd->start_workspace + WORK_SIZE_CHECK) /* Check for overrun */
{
*errorcodeptr = ERR52;
goto FAILED;
@@ -2494,7 +2499,7 @@ for (;; ptr++)
/* In the real compile phase, just check the workspace used by the forward
reference list. */
- else if (cd->hwm > cd->start_workspace + COMPILE_WORK_SIZE)
+ else if (cd->hwm > cd->start_workspace + WORK_SIZE_CHECK)
{
*errorcodeptr = ERR52;
goto FAILED;
diff --git a/erts/emulator/pcre/pcre_exec.c b/erts/emulator/pcre/pcre_exec.c
index 51625130c3..3fe13ca32e 100644
--- a/erts/emulator/pcre/pcre_exec.c
+++ b/erts/emulator/pcre/pcre_exec.c
@@ -5191,7 +5191,6 @@ for(;;)
EDEBUGF(("Loop limit break detected"));
return PCRE_ERROR_LOOP_LIMIT;
RESTART_INTERRUPTED:
- md->match_call_count = 0;
md->loop_limit = extra_data->loop_limit;
rc = match(NULL,NULL,NULL,0,md,0,NULL,0,0);
*extra_data->loop_counter_return =
diff --git a/erts/emulator/test/beam_SUITE.erl b/erts/emulator/test/beam_SUITE.erl
index cc1626630b..228ff15341 100644
--- a/erts/emulator/test/beam_SUITE.erl
+++ b/erts/emulator/test/beam_SUITE.erl
@@ -1,26 +1,26 @@
%%
%% %CopyrightBegin%
-%%
-%% Copyright Ericsson AB 1998-2009. All Rights Reserved.
-%%
+%%
+%% Copyright Ericsson AB 1998-2010. All Rights Reserved.
+%%
%% The contents of this file are subject to the Erlang Public License,
%% Version 1.1, (the "License"); you may not use this file except in
%% compliance with the License. You should have received a copy of the
%% Erlang Public License along with this software. If not, it can be
%% retrieved online at http://www.erlang.org/.
-%%
+%%
%% Software distributed under the License is distributed on an "AS IS"
%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
%% the License for the specific language governing rights and limitations
%% under the License.
-%%
+%%
%% %CopyrightEnd%
%%
-module(beam_SUITE).
-export([all/1, packed_registers/1, apply_last/1, apply_last_bif/1,
- buildo_mucho/1, heap_sizes/1, big_lists/1]).
+ buildo_mucho/1, heap_sizes/1, big_lists/1, fconv/1]).
-export([applied/2]).
@@ -279,3 +279,26 @@ b() ->
_} ->
ok
end.
+
+fconv(Config) when is_list(Config) ->
+ ?line do_fconv(atom),
+ ?line do_fconv(nil),
+ ?line do_fconv(tuple_literal),
+ ?line 3.0 = do_fconv(1.0, 2.0),
+ ok.
+
+do_fconv(Type) ->
+ try
+ do_fconv(Type, 1.0),
+ test_server:fail()
+ catch
+ error:badarith ->
+ ok
+ end.
+
+do_fconv(atom, Float) when is_float(Float) ->
+ Float + a;
+do_fconv(nil, Float) when is_float(Float) ->
+ Float + [];
+do_fconv(tuple_literal, Float) when is_float(Float) ->
+ Float + {a,b}.
diff --git a/erts/epmd/src/epmd_int.h b/erts/epmd/src/epmd_int.h
index 65fcf9bacb..0e432e2cb0 100644
--- a/erts/epmd/src/epmd_int.h
+++ b/erts/epmd/src/epmd_int.h
@@ -192,26 +192,18 @@
#define FAMILY AF_INET6
#define SET_ADDR_LOOPBACK(addr, af, port) do { \
- static u_int32_t __addr[4] = IN6ADDR_LOOPBACK_INIT; \
memset((char*)&(addr), 0, sizeof(addr)); \
(addr).sin6_family = (af); \
(addr).sin6_flowinfo = 0; \
- (addr).sin6_addr.s6_addr32[0] = __addr[0]; \
- (addr).sin6_addr.s6_addr32[1] = __addr[1]; \
- (addr).sin6_addr.s6_addr32[2] = __addr[2]; \
- (addr).sin6_addr.s6_addr32[3] = __addr[3]; \
+ (addr).sin6_addr = in6addr_loopback; \
(addr).sin6_port = htons(port); \
} while(0)
#define SET_ADDR_ANY(addr, af, port) do { \
- static u_int32_t __addr[4] = IN6ADDR_ANY_INIT; \
memset((char*)&(addr), 0, sizeof(addr)); \
(addr).sin6_family = (af); \
(addr).sin6_flowinfo = 0; \
- (addr).sin6_addr.s6_addr32[0] = __addr[0]; \
- (addr).sin6_addr.s6_addr32[1] = __addr[1]; \
- (addr).sin6_addr.s6_addr32[2] = __addr[2]; \
- (addr).sin6_addr.s6_addr32[3] = __addr[3]; \
+ (addr).sin6_addr = in6addr_any; \
(addr).sin6_port = htons(port); \
} while(0)