Skip to content

Commit b82bc8d

Browse files
Merge pull request #1463 from adrian-prantl/scalar
Disable loading scalars as addresses when materializing an entity var…
2 parents 9437a19 + 92c8cf1 commit b82bc8d

File tree

5 files changed

+34
-5
lines changed

5 files changed

+34
-5
lines changed

lldb/source/Expression/Materializer.cpp

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -489,10 +489,7 @@ class EntityVariable : public Materializer::Entity {
489489
}
490490
} else {
491491
AddressType address_type = eAddressTypeInvalid;
492-
const bool scalar_is_load_address = m_is_generic; // this is the only
493-
// time we're dealing
494-
// with dynamic values
495-
492+
const bool scalar_is_load_address = false;
496493
lldb::addr_t addr_of_valobj =
497494
valobj_sp->GetAddressOf(scalar_is_load_address, &address_type);
498495

lldb/test/API/lang/swift/expression/class_constrained_protocol/TestClassConstrainedProtocol.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ def test_extension_weak_self (self):
2424
self.do_self_test("Break here for weak self")
2525

2626
@swiftTest
27-
@expectedFailureAll(oslist=["linux"], bugnumber="rdar://31822722")
2827
def test_extension_self (self):
2928
"""Test that we can reconstruct self in method of a class constrained protocol."""
3029
self.build()
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
SWIFT_SOURCES := main.swift
2+
3+
include Makefile.rules
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# TestSelfFromRegister.py
2+
#
3+
# This source file is part of the Swift.org open source project
4+
#
5+
# Copyright (c) 2014 - 2020 Apple Inc. and the Swift project authors
6+
# Licensed under Apache License v2.0 with Runtime Library Exception
7+
#
8+
# See https://swift.org/LICENSE.txt for license information
9+
# See https://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
10+
#
11+
# ------------------------------------------------------------------------------
12+
13+
import lldbsuite.test.lldbinline as lldbinline
14+
from lldbsuite.test.decorators import *
15+
16+
# Test that loading self from a register works as expected
17+
lldbinline.MakeInlineTest(__file__, globals(), decorators=[swiftTest])
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
class C : CP {
2+
let f: Int = 12345
3+
}
4+
5+
protocol CP : class {}
6+
7+
extension CP {
8+
func foo() {
9+
print(self) //% self.expect('e f', substrs=[' = 12345'])
10+
}
11+
}
12+
13+
C().foo()

0 commit comments

Comments
 (0)