Browse Source

Added sizeof support for Self.

woollybah 11 năm trước cách đây
mục cha
commit
7572b5d09b
1 tập tin đã thay đổi với 3 bổ sung0 xóa
  1. 3 0
      ctranslator.bmx

+ 3 - 0
ctranslator.bmx

@@ -1127,6 +1127,9 @@ EndRem
 		Else If TIdentTypeExpr(expr.expr) Then
 		Else If TIdentTypeExpr(expr.expr) Then
 			' doing something like : SizeOf TMyType
 			' doing something like : SizeOf TMyType
 			Return Bra(TIdentTypeExpr(expr.expr).cdecl.munged + ".instance_size-(sizeof(void*))")
 			Return Bra(TIdentTypeExpr(expr.expr).cdecl.munged + ".instance_size-(sizeof(void*))")
+		
+		Else If TSelfExpr(expr.expr) Then
+			Return Bra("o->clas->instance_size-(sizeof(void*))")
 		End If
 		End If
 		
 		
 		InternalErr
 		InternalErr