Skip to content

Conversation

@sxlijin
Copy link
Collaborator

@sxlijin sxlijin commented Oct 22, 2025

No description provided.

@vercel
Copy link

vercel bot commented Oct 22, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
promptfiddle Error Error Oct 22, 2025 9:38pm

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +1524 to +1533
fn emit_annotated_block(&mut self, v: &str) {
self.emit_string_literal(v);
let mut function_name: [u8; 1024] = [0; 1024];
function_name.copy_from_slice(v.as_bytes());
// null terminate the vec in case its too long
function_name[std::cmp::min(v.len(), 1023)] = 0;

let mut block_name: [u8; 1024] = [0; 1024];
block_name.copy_from_slice(v.as_bytes());
// null terminate the vec in case its too long

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P0 Badge Avoid panicking when copying annotation labels

The new emit_annotated_block allocates two 1024‑byte buffers and fills them with function_name.copy_from_slice(v.as_bytes()) and block_name.copy_from_slice(v.as_bytes()). copy_from_slice requires that the source and destination slices have exactly the same length, so any annotation label shorter than 1024 bytes will cause an immediate panic during code generation. Since all the added test annotations are much shorter than 1024, any annotated statement now crashes the compiler before bytecode is produced. Use a bounded copy (e.g. slicing the destination to ..v.len()) instead of copy_from_slice on the whole array.

Useful? React with 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants