1.1 --- a/templates/native/program.c Fri Jan 20 22:03:27 2017 +0100
1.2 +++ b/templates/native/program.c Fri Jan 20 23:04:12 2017 +0100
1.3 @@ -1,6 +1,6 @@
1.4 /* Native functions for program operations.
1.5
1.6 -Copyright (C) 2016 Paul Boddie <paul@boddie.org.uk>
1.7 +Copyright (C) 2016, 2017 Paul Boddie <paul@boddie.org.uk>
1.8
1.9 This program is free software; you can redistribute it and/or modify it under
1.10 the terms of the GNU General Public License as published by the Free Software
1.11 @@ -30,8 +30,13 @@
1.12 {
1.13 __attr * const callable = &__args[1];
1.14 __attr * const instance = &__args[2];
1.15 + __attr out;
1.16
1.17 - return __replace_context(instance->value, *callable);
1.18 + out = __replace_context(instance->value, *callable);
1.19 + if (out.value == 0)
1.20 + __raise_type_error();
1.21 +
1.22 + return out;
1.23 }
1.24
1.25 /* Module initialisation. */