Merge ../YAPDroid/yap

This commit is contained in:
Vitor Santos Costa 2018-06-15 14:05:43 +01:00
commit ca814eef07
3 changed files with 8 additions and 11 deletions

View File

@ -633,6 +633,7 @@ type_of_verb(rest,passive).
*/ */
#include <Yatom.h>
#include "absmi.h" #include "absmi.h"
#include "YapCompile.h" #include "YapCompile.h"
#if DEBUG #if DEBUG
@ -2940,13 +2941,15 @@ yamop *Yap_PredIsIndexable(PredEntry *ap, UInt NSlots, yamop *next_pc) {
cint.cls = NULL; cint.cls = NULL;
LOCAL_Error_Size = 0; LOCAL_Error_Size = 0;
if (ap->cs.p_code.NOfClauses < 2)
return NULL;
if ((setjres = sigsetjmp(cint.CompilerBotch, 0)) == 3) { if ((setjres = sigsetjmp(cint.CompilerBotch, 0)) == 3) {
restore_machine_regs(); restore_machine_regs();
recover_from_failed_susp_on_cls(&cint, 0); recover_from_failed_susp_on_cls(&cint, 0);
if (!Yap_gcl(LOCAL_Error_Size, ap->ArityOfPE + NSlots, ENV, next_pc)) { if (!Yap_gcl(LOCAL_Error_Size, ap->ArityOfPE + NSlots, ENV, next_pc)) {
CleanCls(&cint); CleanCls(&cint);
Yap_Error(RESOURCE_ERROR_STACK, TermNil, LOCAL_ErrorMessage); Yap_Error(RESOURCE_ERROR_STACK, TermNil, LOCAL_ErrorMessage);
return FAILCODE; return NULL;
} }
} else if (setjres == 2) { } else if (setjres == 2) {
restore_machine_regs(); restore_machine_regs();

View File

@ -1351,6 +1351,7 @@ TokEntry *Yap_tokenizer(struct stream_desc *st, bool store_comments,
p = NULL; /* Just to make lint happy */ p = NULL; /* Just to make lint happy */
ch = getchr(st); ch = getchr(st);
while (chtype(ch) == BS) { while (chtype(ch) == BS) {
och=ch;
ch = getchr(st); ch = getchr(st);
} }
*tposp = Yap_StreamPosition(st - GLOBAL_Stream); *tposp = Yap_StreamPosition(st - GLOBAL_Stream);

View File

@ -20,28 +20,21 @@
#ifndef YATOM_H #ifndef YATOM_H
#define YATOM_H 1 #define YATOM_H 1
#ifdef USE_OFFSETS
INLINE_ONLY inline EXTERN Atom AbsAtom(AtomEntry *p); INLINE_ONLY inline EXTERN Atom AbsAtom(AtomEntry *p);
INLINE_ONLY inline EXTERN AtomEntry *RepAtom(Atom a);
#ifdef USE_OFFSETS
INLINE_ONLY inline EXTERN Atom AbsAtom(AtomEntry *p) { INLINE_ONLY inline EXTERN Atom AbsAtom(AtomEntry *p) {
return (Atom)(Addr(p) - AtomBase); return (Atom)(Addr(p) - AtomBase);
} }
INLINE_ONLY inline EXTERN AtomEntry *RepAtom(Atom a);
INLINE_ONLY inline EXTERN AtomEntry *RepAtom(Atom a) { INLINE_ONLY inline EXTERN AtomEntry *RepAtom(Atom a) {
return (AtomEntry *) (AtomBase + Unsigned (a); return (AtomEntry *) (AtomBase + Unsigned (a);
} }
#else #else
INLINE_ONLY inline EXTERN Atom AbsAtom(AtomEntry *p);
INLINE_ONLY inline EXTERN Atom AbsAtom(AtomEntry *p) { return (Atom)(p); } INLINE_ONLY inline EXTERN Atom AbsAtom(AtomEntry *p) { return (Atom)(p); }
INLINE_ONLY inline EXTERN AtomEntry *RepAtom(Atom a);
INLINE_ONLY inline EXTERN AtomEntry *RepAtom(Atom a) { INLINE_ONLY inline EXTERN AtomEntry *RepAtom(Atom a) {
return (AtomEntry *)(a); return (AtomEntry *)(a);
} }