mirror of
https://github.com/janet-lang/janet
synced 2024-12-26 00:10:27 +00:00
No errors compiling on BU linux (CentOS).
This commit is contained in:
parent
a86540a876
commit
0389971049
@ -239,6 +239,9 @@ static int32_t doarg_1(
|
||||
int32_t ret = -1;
|
||||
JanetTable *c;
|
||||
switch (argtype) {
|
||||
default:
|
||||
c = NULL;
|
||||
break;
|
||||
case JANET_OAT_SLOT:
|
||||
c = &a->slots;
|
||||
break;
|
||||
@ -248,13 +251,6 @@ static int32_t doarg_1(
|
||||
case JANET_OAT_CONSTANT:
|
||||
c = &a->constants;
|
||||
break;
|
||||
case JANET_OAT_INTEGER:
|
||||
c = NULL;
|
||||
break;
|
||||
case JANET_OAT_TYPE:
|
||||
case JANET_OAT_SIMPLETYPE:
|
||||
c = NULL;
|
||||
break;
|
||||
case JANET_OAT_LABEL:
|
||||
c = &a->labels;
|
||||
break;
|
||||
@ -516,6 +512,7 @@ static JanetAssembleResult janet_asm1(JanetAssembler *parent, Janet source, int
|
||||
janet_asm_deinit(&a);
|
||||
longjmp(a.parent->on_error, 1);
|
||||
}
|
||||
result.funcdef = NULL;
|
||||
result.error = a.errmessage;
|
||||
result.status = JANET_ASSEMBLE_ERROR;
|
||||
janet_asm_deinit(&a);
|
||||
@ -723,6 +720,7 @@ static JanetAssembleResult janet_asm1(JanetAssembler *parent, Janet source, int
|
||||
|
||||
/* Finish everything and return funcdef */
|
||||
janet_asm_deinit(&a);
|
||||
result.error = NULL;
|
||||
result.funcdef = def;
|
||||
result.status = JANET_ASSEMBLE_OK;
|
||||
return result;
|
||||
|
@ -97,18 +97,18 @@ void janetc_scope(JanetScope *s, JanetCompiler *c, int flags, const char *name)
|
||||
scope.selfconst = -1;
|
||||
scope.bytecode_start = janet_v_count(c->buffer);
|
||||
scope.flags = flags;
|
||||
*s = scope;
|
||||
scope.parent = c->scope;
|
||||
/* Inherit slots */
|
||||
if ((!(flags & JANET_SCOPE_FUNCTION)) && c->scope) {
|
||||
janetc_regalloc_clone(&s->ra, &(c->scope->ra));
|
||||
janetc_regalloc_clone(&scope.ra, &(c->scope->ra));
|
||||
} else {
|
||||
janetc_regalloc_init(&s->ra);
|
||||
janetc_regalloc_init(&scope.ra);
|
||||
}
|
||||
/* Link parent and child and update pointer */
|
||||
s->parent = c->scope;
|
||||
if (c->scope)
|
||||
c->scope->child = s;
|
||||
c->scope = s;
|
||||
*s = scope;
|
||||
}
|
||||
|
||||
/* Leave a scope. */
|
||||
|
@ -20,7 +20,10 @@
|
||||
* IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
/* Compiler feature test macros for things */
|
||||
#define _DEFAULT_SOURCE
|
||||
#define _BSD_SOURCE
|
||||
|
||||
#include <stdio.h>
|
||||
#include <janet/janet.h>
|
||||
#include <errno.h>
|
||||
|
Loading…
Reference in New Issue
Block a user