Skip to content

Commit

Permalink
fix undefined behaviour when loading control file
Browse files Browse the repository at this point in the history
Signed-off-by: usamoi <[email protected]>
  • Loading branch information
usamoi committed Jan 8, 2024
1 parent 7df371d commit 7e82754
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions cargo-pgrx/src/command/schema.rs
Original file line number Diff line number Diff line change
Expand Up @@ -401,12 +401,12 @@ pub(crate) fn generate_schema(
.wrap_err_with(|| format!("Couldn't libload {}", lib_so.display()))?;

let symbol: libloading::os::unix::Symbol<
unsafe extern "Rust" fn() -> eyre::Result<pgrx_sql_entity_graph::ControlFile>,
unsafe extern "Rust" fn() -> pgrx_sql_entity_graph::ControlFile,
> = lib
.get("__pgrx_marker".as_bytes())
.expect("Couldn't call __pgrx_marker");
let control_file_entity = pgrx_sql_entity_graph::SqlGraphEntity::ExtensionRoot(
symbol().expect("Failed to get control file information"),
symbol(),
);
entities.push(control_file_entity);

Expand Down

0 comments on commit 7e82754

Please sign in to comment.