diff options
Diffstat (limited to '')
-rw-r--r-- | Makefile | 12 | ||||
-rw-r--r-- | src/tools.cpp | 2 | ||||
-rw-r--r-- | tests/errhangtest.lua | 15 |
3 files changed, 19 insertions, 10 deletions
@@ -81,8 +81,8 @@ test: | |||
81 | $(MAKE) fibonacci | 81 | $(MAKE) fibonacci |
82 | $(MAKE) fifo | 82 | $(MAKE) fifo |
83 | $(MAKE) func_is_string | 83 | $(MAKE) func_is_string |
84 | $(MAKE) irayo_recursive | ||
85 | $(MAKE) irayo_closure | 84 | $(MAKE) irayo_closure |
85 | $(MAKE) irayo_recursive | ||
86 | $(MAKE) keeper | 86 | $(MAKE) keeper |
87 | $(MAKE) linda_perf | 87 | $(MAKE) linda_perf |
88 | $(MAKE) objects | 88 | $(MAKE) objects |
@@ -104,8 +104,8 @@ cancel: tests/cancel.lua $(_TARGET_SO) | |||
104 | REP_ARGS=-llanes -e "print'say aaa'; for i=1,10 do print(i) end" | 104 | REP_ARGS=-llanes -e "print'say aaa'; for i=1,10 do print(i) end" |
105 | repetitive: $(_TARGET_SO) | 105 | repetitive: $(_TARGET_SO) |
106 | for i in 1 2 3 4 5 6 7 8 9 10 a b c d e f g h i j k l m n o p q r s t u v w x y z; \ | 106 | for i in 1 2 3 4 5 6 7 8 9 10 a b c d e f g h i j k l m n o p q r s t u v w x y z; \ |
107 | do $(_PREFIX) $(LUA) $(REP_ARGS); \ | 107 | do $(_PREFIX) $(LUA) $(REP_ARGS); \ |
108 | done | 108 | done |
109 | 109 | ||
110 | repetitive1: $(_TARGET_SO) | 110 | repetitive1: $(_TARGET_SO) |
111 | $(_PREFIX) $(LUA) $(REP_ARGS) | 111 | $(_PREFIX) $(LUA) $(REP_ARGS) |
@@ -236,9 +236,9 @@ else | |||
236 | -rm -rf $(MODULE)-$(VERSION) | 236 | -rm -rf $(MODULE)-$(VERSION) |
237 | mkdir $(MODULE)-$(VERSION) | 237 | mkdir $(MODULE)-$(VERSION) |
238 | tar c * --exclude=.svn --exclude=.DS_Store --exclude="_*" \ | 238 | tar c * --exclude=.svn --exclude=.DS_Store --exclude="_*" \ |
239 | --exclude="*.tgz" --exclude="*.rockspec" \ | 239 | --exclude="*.tgz" --exclude="*.rockspec" \ |
240 | --exclude=lanes.dev --exclude="$(MODULE)-*" --exclude=xcode \ | 240 | --exclude=lanes.dev --exclude="$(MODULE)-*" --exclude=xcode \ |
241 | --exclude="*.obj" --exclude="*.dll" --exclude=timeit.dat \ | 241 | --exclude="*.obj" --exclude="*.dll" --exclude=timeit.dat \ |
242 | | (cd $(MODULE)-$(VERSION) && tar x) | 242 | | (cd $(MODULE)-$(VERSION) && tar x) |
243 | tar czvf $(MODULE)-$(VERSION).tgz $(MODULE)-$(VERSION) | 243 | tar czvf $(MODULE)-$(VERSION).tgz $(MODULE)-$(VERSION) |
244 | rm -rf $(MODULE)-$(VERSION) | 244 | rm -rf $(MODULE)-$(VERSION) |
diff --git a/src/tools.cpp b/src/tools.cpp index 4a6f2a2..a0a3018 100644 --- a/src/tools.cpp +++ b/src/tools.cpp | |||
@@ -1446,7 +1446,7 @@ static void copy_cached_func(Universe* U, Dest L2, int L2_cache_i, Source L, int | |||
1446 | int key_i = val_i - 1; | 1446 | int key_i = val_i - 1; |
1447 | 1447 | ||
1448 | // Only basic key types are copied over; others ignored | 1448 | // Only basic key types are copied over; others ignored |
1449 | if (inter_copy_one(U, L2, 0 /*key*/, L, key_i, VT::KEY, mode_, upName_)) | 1449 | if (inter_copy_one(U, L2, L2_cache_i, L, key_i, VT::KEY, mode_, upName_)) |
1450 | { | 1450 | { |
1451 | char* valPath = (char*) upName_; | 1451 | char* valPath = (char*) upName_; |
1452 | if( U->verboseErrors) | 1452 | if( U->verboseErrors) |
diff --git a/tests/errhangtest.lua b/tests/errhangtest.lua index 7286fa5..d26dcef 100644 --- a/tests/errhangtest.lua +++ b/tests/errhangtest.lua | |||
@@ -4,10 +4,19 @@ local linda = lanes.linda() | |||
4 | 4 | ||
5 | local coro = coroutine.create(function() end) | 5 | local coro = coroutine.create(function() end) |
6 | 6 | ||
7 | local fun = function() print "fun" end | ||
8 | local t_in = { [fun] = fun, fun = fun } | ||
9 | |||
10 | -- send a string | ||
11 | print( pcall(linda.send,linda, 'test', "oh boy")) | ||
12 | -- send a table that contains a function | ||
13 | print( pcall(linda.send,linda, 'test', t_in)) | ||
7 | -- we are not allowed to send coroutines through a lanes | 14 | -- we are not allowed to send coroutines through a lanes |
8 | -- however, this should raise an error, not hang the program... | 15 | -- however, this should raise an error, not hang the program... |
9 | print( pcall(linda.send,linda, 'test', "oh boy")) | ||
10 | print( pcall(linda.send,linda, 'test', coro)) | 16 | print( pcall(linda.send,linda, 'test', coro)) |
11 | k,res = linda:receive('test') | 17 | k,str = linda:receive('test') -- read the contents successfully sent |
12 | print( res) | 18 | print( str) -- "oh boy" |
19 | k,t_out = linda:receive('test') -- read the contents successfully sent | ||
20 | t_out.fun() -- "fun" | ||
13 | -- linda:send( 'test', coro) | 21 | -- linda:send( 'test', coro) |
22 | print "SUCCESS" \ No newline at end of file | ||