From d8004ff2dc60902bdee1eea0ccc4ffaa04dc1e45 Mon Sep 17 00:00:00 2001 From: Dmitry Vyukov Date: Sat, 17 Nov 2018 15:35:47 -0800 Subject: pkg/compiler: add vma64 type 8-byte vma is needed in several places in linux descriptions. --- pkg/compiler/testdata/all.txt | 7 +++++++ pkg/compiler/types.go | 5 ++++- 2 files changed, 11 insertions(+), 1 deletion(-) (limited to 'pkg/compiler') diff --git a/pkg/compiler/testdata/all.txt b/pkg/compiler/testdata/all.txt index 6fff34284..6863e5836 100644 --- a/pkg/compiler/testdata/all.txt +++ b/pkg/compiler/testdata/all.txt @@ -68,6 +68,13 @@ foo$len_templ(a ptr[in, len_templ1[int8, int16]]) foo$len_var0(a ptr[in, array[string]], b len[a]) foo$len_var1(a ptr[in, array[string]], b ptr[in, len[a, int32]]) +# Pointer type. + +foo$ptr(a ptr[in, int64]) +foo$ptr64(a ptr64[in, int64]) +foo$vma(a vma) +foo$vma64(a vma64) + # Void type. void0 { diff --git a/pkg/compiler/types.go b/pkg/compiler/types.go index 777920f57..98edc9d74 100644 --- a/pkg/compiler/types.go +++ b/pkg/compiler/types.go @@ -288,7 +288,7 @@ var typeFileoff = &typeDesc{ } var typeVMA = &typeDesc{ - Names: []string{"vma"}, + Names: []string{"vma", "vma64"}, CanBeArgRet: canBeArg, OptArgs: 1, Args: []namedArg{{Name: "size range", Type: typeArgSizeRange}}, @@ -298,6 +298,9 @@ var typeVMA = &typeDesc{ begin, end = args[0].Value, args[0].Value2 } base.TypeSize = comp.ptrSize + if t.Ident == "vma64" { + base.TypeSize = 8 + } return &prog.VmaType{ TypeCommon: base.TypeCommon, RangeBegin: begin, -- cgit mrf-deployment