Fix panic in builds with no device
Running prebuilts/build-tools/build-prebuilts.sh in a repo that contains art/build/art.go panics because config.Targets[Device] is empty. Check the length before accessing the slice. Test: prebuilts/build-tools/build-prebuilts.sh Change-Id: Ifb9fe0fad07b22d6b574f505c08c5c761278aad0
This commit is contained in:
@@ -466,7 +466,11 @@ func (c *config) LibartImgHostBaseAddress() string {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (c *config) LibartImgDeviceBaseAddress() string {
|
func (c *config) LibartImgDeviceBaseAddress() string {
|
||||||
switch c.Targets[Device][0].Arch.ArchType {
|
archType := Common
|
||||||
|
if len(c.Targets[Device]) > 0 {
|
||||||
|
archType = c.Targets[Device][0].Arch.ArchType
|
||||||
|
}
|
||||||
|
switch archType {
|
||||||
default:
|
default:
|
||||||
return "0x70000000"
|
return "0x70000000"
|
||||||
case Mips, Mips64:
|
case Mips, Mips64:
|
||||||
|
Reference in New Issue
Block a user