@@ -576,7 +576,7 @@ public AHashMap<ACell,ACell> lookupMeta(Symbol sym) {
576
576
*/
577
577
public AHashMap <ACell ,ACell > lookupMeta (Address address ,Symbol sym ) {
578
578
AccountStatus as =(address ==null )?getAccountStatus ():getAccountStatus (address );
579
- for (int i =0 ; i <16 ; i ++) {
579
+ for (int i =0 ; i <Constants . LOOKUP_DEPTH ; i ++) {
580
580
if (as ==null ) return null ;
581
581
AHashMap <Symbol , ACell > env =as .getEnvironment ();
582
582
if (env .containsKey (sym )) {
@@ -599,7 +599,8 @@ public Context lookupDefiningAddress(Address address,Symbol sym) {
599
599
Context ctx =this ;
600
600
Address addr =(address ==null )?getAddress ():address ;
601
601
602
- while (addr !=null ) {
602
+ for (int i =0 ; i <Constants .LOOKUP_DEPTH ; i ++) {
603
+ if (addr ==null ) break ;
603
604
AccountStatus as =getAccountStatus (addr );
604
605
if (as ==null ) return ctx .withResult (Juice .LOOKUP , null );
605
606
@@ -672,7 +673,7 @@ public MapEntry<Symbol,ACell> lookupDynamicEntry(Address address,Symbol sym) {
672
673
673
674
private MapEntry <Symbol ,ACell > lookupDynamicEntry (AccountStatus as ,Symbol sym ) {
674
675
// Get environment for Address, or default to initial environment
675
- for (int i =0 ; i <16 ; i ++) {
676
+ for (int i =0 ; i <Constants . LOOKUP_DEPTH ; i ++) {
676
677
if (as ==null ) return Core .ENVIRONMENT .getEntry (sym );
677
678
678
679
MapEntry <Symbol ,ACell > result =as .getEnvironment ().getEntry (sym );
0 commit comments