diff --git a/TODO.FACTOR.txt b/TODO.FACTOR.txt index e3a8aeb901..1f966c1c36 100644 --- a/TODO.FACTOR.txt +++ b/TODO.FACTOR.txt @@ -1,6 +1,8 @@ - live search: timer delay would be nice - help responder has no way to access { "foo" "bar" } - httpd search tools +- condition rethrow restarts broken +- menus broken (right click, left click another word) + ui: diff --git a/library/compiler/alien/alien-invoke.factor b/library/compiler/alien/alien-invoke.factor index 5e731b80b4..b4ca412989 100644 --- a/library/compiler/alien/alien-invoke.factor +++ b/library/compiler/alien/alien-invoke.factor @@ -24,6 +24,10 @@ M: alien-invoke-error summary : alien-invoke ( ... return library function parameters -- ... ) pick pick throw ; +: ensure-dlsym ( node -- ) + [ alien-invoke-dlsym dlsym drop ] + [ inference-warning ] recover ; + \ alien-invoke [ string object string object ] [ ] "infer-effect" set-word-prop @@ -33,7 +37,7 @@ M: alien-invoke-error summary pop-literal nip over set-alien-invoke-function pop-literal nip over set-alien-invoke-library pop-literal nip over set-alien-invoke-return - dup alien-invoke-dlsym dlsym drop + dup ensure-dlsym alien-invoke-stack ] "infer" set-word-prop diff --git a/library/compiler/x86/architecture.factor b/library/compiler/x86/architecture.factor index 76e7a8fc04..76c27465cb 100644 --- a/library/compiler/x86/architecture.factor +++ b/library/compiler/x86/architecture.factor @@ -44,7 +44,7 @@ M: cs-loc v>operand cs-loc-n cs-reg reg-stack ; #! so this is mostly a no-op. swap slip stack-reg swap ADD ; inline -: compile-c-call* ( symbol dll args -- operands ) +: compile-c-call* ( symbol dll args -- ) dup length cells [ [ PUSH ] each %alien-invoke ] with-aligned-stack ; diff --git a/library/tools/errors.factor b/library/tools/errors.factor index 6af6eaf25b..5ad9837cfa 100644 --- a/library/tools/errors.factor +++ b/library/tools/errors.factor @@ -30,7 +30,9 @@ words definitions ; "Cannot convert to C string: " write third . ; : ffi-error. ( obj -- ) - "FFI: " write third print ; + "FFI: " write + dup third [ write ": " write ] when* + fourth print ; : heap-scan-error. ( obj -- ) "Cannot do next-object outside begin/end-scan" print drop ; diff --git a/vm/os-unix.c b/vm/os-unix.c index e78fa0b5e6..1454d2f74a 100644 --- a/vm/os-unix.c +++ b/vm/os-unix.c @@ -22,8 +22,8 @@ void ffi_dlopen(DLL *dll, bool error) { if(error) { - general_error(ERROR_FFI,tag_object( - from_char_string(dlerror())),F,true); + general_error(ERROR_FFI,F, + tag_object(from_char_string(dlerror())),true); } else dll->dll = NULL; @@ -42,8 +42,8 @@ void *ffi_dlsym(DLL *dll, F_STRING *symbol, bool error) { if(error) { - general_error(ERROR_FFI,tag_object( - from_char_string(dlerror())),F,true); + general_error(ERROR_FFI,tag_object(symbol), + tag_object(from_char_string(dlerror())),true); } return NULL; diff --git a/vm/os-windows.c b/vm/os-windows.c index 08faa1e126..7fe4300f9c 100644 --- a/vm/os-windows.c +++ b/vm/os-windows.c @@ -58,7 +58,7 @@ void ffi_dlopen (DLL *dll, bool error) { dll->dll = NULL; if(error) - general_error(ERROR_FFI, tag_object(get_error_message()),F,true); + general_error(ERROR_FFI, F, tag_object(get_error_message()),true); else return; } @@ -74,7 +74,8 @@ void *ffi_dlsym (DLL *dll, F_STRING *symbol, bool error) if (!sym) { if(error) - general_error(ERROR_FFI, tag_object(get_error_message()),F,true); + general_error(ERROR_FFI, tag_object(symbol), + tag_object(get_error_message()),true); else return NULL; }