From: DeaDDooMER Date: Fri, 28 Jul 2017 18:27:40 +0000 (+0300) Subject: Поправлено определение создания указателя на указатель X-Git-Url: http://deadsoftware.ru/gitweb?a=commitdiff_plain;h=bd4b622f2ffd3fceefd9caeaff35662a13af201c;p=dsw-obn.git Поправлено определение создания указателя на указатель --- diff --git a/src/oberon.c b/src/oberon.c index 89f4be4..251a7df 100644 --- a/src/oberon.c +++ b/src/oberon.c @@ -2201,7 +2201,8 @@ oberon_prevent_recursive_pointer(oberon_context_t * ctx, oberon_type_t * type) oberon_error(ctx, "recursive pointer declaration"); } - if(type -> base -> class == OBERON_TYPE_POINTER) + if(type -> class == OBERON_TYPE_POINTER + && type -> base -> class == OBERON_TYPE_POINTER) { oberon_error(ctx, "attempt to make pointer to pointer"); } diff --git a/src/test.c b/src/test.c index 51a1250..02912bb 100644 --- a/src/test.c +++ b/src/test.c @@ -13,9 +13,10 @@ static char source_test[] = "VAR" " g : ARRAY 4 OF INTEGER;" " r : RECORD x : INTEGER; END;" - " a : POINTER TO ARRAY OF ARRAY OF RecDesc;" + " a : POINTER TO ARRAY OF ARRAY OF Rec;" "BEGIN" " NEW(a, 10, 10);" + " NEW(a[9, 9]);" " a[9, 9].x := 666;" " g[3] := 4;" " r.x := 4546;"