[vala/staging: 2/2] vala: Don't use possibly uninitialized backing field of package_name
- From: Rico Tzschichholz <ricotz src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [vala/staging: 2/2] vala: Don't use possibly uninitialized backing field of package_name
- Date: Sat, 11 Apr 2020 08:04:03 +0000 (UTC)
commit 305a4112f1261248c2a7f8882c250a6bdc7e3d0a
Author: Princeton Ferro <princetonferro gmail com>
Date: Sat Apr 11 03:32:54 2020 -0400
vala: Don't use possibly uninitialized backing field of package_name
Don't check _package_name directly, which may be null at the time
installed_version is accessed. This fixes a bug where Vala wouldn't
generate errors when using symbols that are unavailable for a package
version.
Introduced by 7f0e90a5c34f437b7ab8f9197a9d42fc835b1a60
Fixes https://gitlab.gnome.org/GNOME/vala/issues/971
vala/valasourcefile.vala | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
---
diff --git a/vala/valasourcefile.vala b/vala/valasourcefile.vala
index 2e270a06c..ac9000f49 100644
--- a/vala/valasourcefile.vala
+++ b/vala/valasourcefile.vala
@@ -70,7 +70,7 @@ public class Vala.SourceFile {
_version_requested = true;
- if (_package_name != null) {
+ if (package_name != null) {
_installed_version = context.pkg_config_modversion (package_name);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]