@@ -1,4 +1,4 @@
-7dffb933d33ff288675c8094d05c31b35cbf7e4d
+263e8d2a2ab57c6f2b3035f370d40476bda87c9f
The first line of this file holds the git revision number of the last
merge done from the gofrontend repository.
@@ -2123,9 +2123,15 @@ String_expression::do_get_backend(Translate_context* context)
Location loc = this->location();
std::vector<Bexpression*> init(2);
- Bexpression* str_cst =
- gogo->backend()->string_constant_expression(this->val_);
- init[0] = gogo->backend()->address_expression(str_cst, loc);
+
+ if (this->val_.size() == 0)
+ init[0] = gogo->backend()->nil_pointer_expression();
+ else
+ {
+ Bexpression* str_cst =
+ gogo->backend()->string_constant_expression(this->val_);
+ init[0] = gogo->backend()->address_expression(str_cst, loc);
+ }
Btype* int_btype = Type::lookup_integer_type("int")->get_backend(gogo);
mpz_t lenval;