8000 [DO NOT MERGE] Apply Rust patches on release/8.x by cuviper · Pull Request #1 · rust-lang/llvm-project · GitHub
[go: up one dir, main page]

Skip to content

[DO NOT MERGE] Apply Rust patches on release/8.x #1

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 25 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
865c1f7
Add accessors for MCSubtargetInfo CPU and Feature tables
bitshifter Jul 10, 2016
122c3dc
Fix compile on dist-i686-linux builder
alexcrichton Jul 28, 2017
b73884a
Disable checks for libatomic for now
alexcrichton Jan 24, 2018
392947a
Add knowledge of __rust_{alloc,realloc,dealloc}
nagisa Jun 3, 2017
bd18bd8
Fix compile on dist-x86_64-linux builder
alexcrichton Jul 2, 2018
b1ec4cb
Compile with /MT on MSVC
alexcrichton Feb 11, 2018
1ecf8ed
Add Rust support to Mangled
tromey Jun 25, 2018
9fa3339
Add DIERef::operator==
tromey Jun 25, 2018
e6a7452
Add a missing TypeAndOrName constructor
tromey Jun 25, 2018
ea4ac97
Add Rust support to the Python test harness
tromey Jun 25, 2018
df47965
The Rust plugin
tromey Jun 25, 2018
b8bd5dc
Compute Python library suffix in CMakeLists.txt
tromey Jul 9, 2018
02ddf76
Do not crash when enum discriminant is not recognized
tromey Aug 7, 2018
0e77fbd
Use correct include path for State.h
tromey Sep 5, 2018
0322285
Add "rust-enabled" to --version output
tromey Oct 2, 2018
d957e27
Fix handling of variant parts
tromey Oct 22, 2018
463cd70
Give names to tuple fields
tromey Oct 25, 2018
945de34
Rename tuple fields after discriminant is removed
tromey Oct 26, 2018
ff0a15a
Fix field names when emitting a C structure
tromey Nov 9, 2018
28e0138
Remove by-name cache from RustASTContext
tromey Nov 9, 2018
af32307
Disable enum type test
tromey Nov 14, 2018
2ed5e5d
Read template parameters for structure types
tromey Nov 14, 2018
8027847
Read template parameters for function types
tromey Nov 14, 2018
0fb81ce
Fix the build after the rebase
tromey Nov 27, 2018
a27fbee
Fix DWARFASTParserRust::ParseFunctionFromDWARF for r350943
cuviper Jan 15, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Do not crash when enum discriminant is not recognized
Sometimes the DWARF can omit information about a discriminant, for
example when an Option shares a discriminant slot with an enum that it
wraps.  In this case, lldb could crash, because the discriminant was
not found and because there was no default variant.

No test case because this relies on a compiler bug that will soon be
fixed.

Fixes #16
  • Loading branch information
tromey authored and cuviper committed Jan 16, 2019
commit 02ddf7625e27b3c45b7a5c9d79bb2ececd923ec7
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,9 @@ bool RustLanguageRuntime::GetDynamicTypeAndAddress(
}

CompilerType variant_type = ast->FindEnumVariant(type, discriminant);
if (!variant_type) {
return false;
}
class_type_or_name = TypeAndOrName(variant_type);
// The address doesn't change.
dynamic_address.SetLoadAddress(original_ptr, exe_ctx.GetTargetPtr());
Expand Down
4 changes: 4 additions & 0 deletions lldb/source/Symbol/RustASTContext.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -625,6 +625,10 @@ class RustEnum : public RustAggregateBase {
int idx = m_default;
if (iter != m_discriminants.end()) {
idx = iter->second;
} else if (idx == -1) {
// If the DWARF was bad somehow, we could end up not finding the
// discriminant and not having a default.
return CompilerType();
}
return FieldAt(idx)->m_type;
}
Expand Down
0