Make CodegenContext reference *android.Context

Previously, it stored an android.Context (no pointer) which while it
worked (because the current contents are themselves pointers) it is
inconsistent with how the rest of the code references it and could
cause weird behavior if additional fields were added to the Context.

Test: m nothing
      m bp2build
Change-Id: I9c70f925dde85e5b15431cc232b0c2eb6371ec6d
This commit is contained in:
Paul Duffin
2022-11-04 13:35:21 +00:00
parent d6dec6f51e
commit c639059fd8
5 changed files with 17 additions and 16 deletions

View File

@@ -22,11 +22,12 @@ package bp2build
// run for longer, set -benchtime to a larger value.
import (
"android/soong/android"
"fmt"
"math"
"strings"
"testing"
"android/soong/android"
)
const (
@@ -105,7 +106,7 @@ func setup(builddir string, tcSize float64) testConfig {
ctx := android.NewTestContext(config)
registerCustomModuleForBp2buildConversion(ctx)
codegenCtx := NewCodegenContext(config, *ctx.Context, Bp2Build)
codegenCtx := NewCodegenContext(config, ctx.Context, Bp2Build)
return testConfig{
config,
ctx,