diff --git a/vlib/v/gen/c/cgen.v b/vlib/v/gen/c/cgen.v
index 78e41a4b7d..97b144f096 100644
--- a/vlib/v/gen/c/cgen.v
+++ b/vlib/v/gen/c/cgen.v
@@ -5181,7 +5181,7 @@ fn c_name(name_ string) string {
 
 fn (mut g Gen) type_default(typ_ ast.Type) string {
 	typ := g.unwrap_generic(typ_)
-	if typ.has_flag(.optional) {
+	if typ.has_flag(.optional) || typ.has_flag(.result) {
 		return '{0}'
 	}
 	// Always set pointers to 0
diff --git a/vlib/v/tests/results_test.v b/vlib/v/tests/results_test.v
index ab4c047987..e8d20a67c9 100644
--- a/vlib/v/tests/results_test.v
+++ b/vlib/v/tests/results_test.v
@@ -63,3 +63,13 @@ fn util_error_propagation() ! {
 fn test_return_on_error_propagation() {
 	util_error_propagation() or { assert err.msg() == 'abc' }
 }
+
+fn unsafe_return_error() !int {
+	unsafe {
+		return error('abc')
+	}
+}
+
+fn test_unsafe_return_error() {
+	unsafe_return_error() or { assert err.msg() == 'abc' }
+}