mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-05 22:02:55 +01:00
Implementation of unformed state for global variables. (#1571)
- Allocate UninitializedValue on heap when a VariableDeclaration does not have initialization. - Added test cases.
This commit is contained in:
@@ -1627,6 +1627,9 @@ auto Interpreter::StepDeclaration() -> ErrorOr<Success> {
|
||||
return todo_.FinishAction();
|
||||
}
|
||||
} else {
|
||||
Nonnull<const Value*> v =
|
||||
arena_->New<UninitializedValue>(&var_decl.binding().value());
|
||||
todo_.Initialize(&var_decl.binding(), v);
|
||||
return todo_.FinishAction();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user