diff --git a/C/arrays.c b/C/arrays.c index bb29bb24d..67c8484de 100644 --- a/C/arrays.c +++ b/C/arrays.c @@ -1826,8 +1826,12 @@ p_static_array_to_term(void) *H++ = (CELL)Yap_MkFunctor(AbsAtom(ae),dim); switch(tp) { case array_of_ints: - for (indx=0; indx < dim; indx++) { - *H++ = MkIntegerTerm(pp->ValueOfVE.ints[indx]); + { + CELL *sptr = H; + H += dim; + for (indx=0; indx < dim; indx++) { + *sptr++ = MkIntegerTerm(pp->ValueOfVE.ints[indx]); + } } break; case array_of_dbrefs: @@ -1856,38 +1860,58 @@ p_static_array_to_term(void) } break; case array_of_doubles: - for (indx=0; indx < dim; indx++) { - *H++ = MkEvalFl(pp->ValueOfVE.floats[indx]); + { + CELL *sptr = H; + H += dim; + for (indx=0; indx < dim; indx++) { + *sptr++ = MkEvalFl(pp->ValueOfVE.floats[indx]); + } } break; case array_of_ptrs: - for (indx=0; indx < dim; indx++) { - *H++ = MkIntegerTerm((Int)(pp->ValueOfVE.ptrs[indx])); + { + CELL *sptr = H; + H += dim; + for (indx=0; indx < dim; indx++) { + *sptr++ = MkIntegerTerm((Int)(pp->ValueOfVE.ptrs[indx])); + } } break; case array_of_chars: - for (indx=0; indx < dim; indx++) { - *H++ = MkIntegerTerm((Int)(pp->ValueOfVE.chars[indx])); + { + CELL *sptr = H; + H += dim; + for (indx=0; indx < dim; indx++) { + *sptr++ = MkIntegerTerm((Int)(pp->ValueOfVE.chars[indx])); + } } break; case array_of_uchars: - for (indx=0; indx < dim; indx++) { - *H++ = MkIntegerTerm((Int)(pp->ValueOfVE.uchars[indx])); + { + CELL *sptr = H; + H += dim; + for (indx=0; indx < dim; indx++) { + *sptr++ = MkIntegerTerm((Int)(pp->ValueOfVE.uchars[indx])); + } } break; case array_of_terms: - for (indx=0; indx < dim; indx++) { - /* The object is now in use */ - DBRef ref = pp->ValueOfVE.terms[indx]; - Term TRef; + { + CELL *sptr = H; + H += dim; + for (indx=0; indx < dim; indx++) { + /* The object is now in use */ + DBRef ref = pp->ValueOfVE.terms[indx]; + Term TRef; - if (ref != NULL) { - TRef = Yap_FetchTermFromDB(ref,3); - } else { - P = (yamop *)FAILCODE; - TRef = TermNil; + if (ref != NULL) { + TRef = Yap_FetchTermFromDB(ref,3); + } else { + P = (yamop *)FAILCODE; + TRef = TermNil; + } + *sptr++ = TRef; } - *H++ = TRef; } break; case array_of_atoms: diff --git a/C/init.c b/C/init.c index d09f770fa..6a268d362 100644 --- a/C/init.c +++ b/C/init.c @@ -970,7 +970,7 @@ InitCodes(void) heap_regs->pred_goal_expansion = RepPredProp(PredPropByFunc(Yap_MkFunctor(Yap_LookupAtom("goal_expansion"),3),1)); heap_regs->env_for_trustfail_code.p = heap_regs->env_for_trustfail_code.p0 = - RepPredProp(PredPropByAtom(Yap_LookupAtom("false"),0)); + RepPredProp(PredPropByAtom(heap_regs->atom_false,0)); { /* make sure we know about the module predicate */ PredEntry *modp = RepPredProp(PredPropByFunc(heap_regs->functor_module,0)); diff --git a/console/yap.c b/console/yap.c index 246faa6d9..1fb3dce14 100644 --- a/console/yap.c +++ b/console/yap.c @@ -467,7 +467,7 @@ exec_top_level(int BootMode, YAP_init_args *iap) do_bootfile (iap->YapPrologBootFile ? iap->YapPrologBootFile : BootFile); livegoal = YAP_FullLookupAtom("$live"); /* initialise the top-level */ - YAP_PutValue(livegoal, YAP_MkAtomTerm (YAP_LookupAtom("true"))); + YAP_PutValue(livegoal, YAP_MkAtomTerm (YAP_FullLookupAtom("$true"))); } /* the top-level is now ready */ @@ -475,7 +475,7 @@ exec_top_level(int BootMode, YAP_init_args *iap) the atom false away ;-). */ livegoal = YAP_FullLookupAtom("$live"); - atomfalse = YAP_MkAtomTerm (YAP_LookupAtom("false")); + atomfalse = YAP_MkAtomTerm (YAP_FullLookupAtom("$false")); while (YAP_GetValue (livegoal) != atomfalse) { YAP_Reset(); do_top_goal (YAP_MkAtomTerm (livegoal)); diff --git a/pl/boot.yap b/pl/boot.yap index 173c4bd9e..a1954fbb5 100644 --- a/pl/boot.yap +++ b/pl/boot.yap @@ -172,7 +172,7 @@ read_sig. '$run_toplevel_hooks', '$command'((?-Command),Varnames,top), '$sync_mmapped_arrays', - '$set_value'('$live',false). + '$set_value'('$live','$false'). '$startup_goals' :- '$recorded'('$startup_goal',G,_), @@ -858,7 +858,7 @@ break :- '$get_value'('$break',BL), NBL is BL+1, '$format'(user_error, "[ Break (level ~w) ]~n", [NBL]), '$do_live', !, - '$set_value'('$live',true), + '$set_value'('$live','$true'), '$set_value'(spy_sl,SPY_SL), '$get_value'(spy_fs,SPY_FS), '$set_value'(spy_sp,SPY_SP),